Skip to content

Update to v0.14.0-rc3 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:

- name: Set up PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
purescript: "0.14.0-rc3"

- name: Cache PureScript dependencies
uses: actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion packages.dhall
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20200831/packages.dhall sha256:cdb3529cac2cd8dd780f07c80fd907d5faceae7decfcaa11a12037df68812c83
https://raw.githubusercontent.com/purescript/package-sets/prepare-0.14/src/packages.dhall

in upstream
1 change: 1 addition & 0 deletions src/Ace/Config.purs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Ace.Types
import Effect (Effect)
import Data.Function.Uncurried (Fn2, runFn2)

newtype ConfigOption :: Type -> Type
newtype ConfigOption a = ConfigOption String

foreign import setImpl :: forall a. Fn2 (ConfigOption a) a (Effect Ace)
Expand Down
19 changes: 10 additions & 9 deletions src/Ace/Document.purs
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,27 @@ module Ace.Document
import Prelude

import Ace.Types (Document, Position, Range, NewlineMode, Anchor, DocumentEvent, readDocumentEvent, showNewlineMode)

import Effect (Effect)
import Control.Monad.Except (runExcept)

import Data.Either (fromRight)
import Foreign (Foreign)
import Data.Either (either)
import Data.Function.Uncurried (Fn2, runFn2, Fn3, runFn3, Fn4, runFn4)
import Data.Nullable (Nullable)

import Partial.Unsafe (unsafePartial)
import Effect (Effect)
import Foreign (Foreign)
import Partial.Unsafe (unsafeCrashWith)

foreign import onChangeImpl
:: forall a
. Fn2 Document (Foreign -> Effect a) (Effect Unit)

onChange
:: forall a
. Document -> (DocumentEvent -> Effect a)
. Document
-> (DocumentEvent -> Effect a)
-> Effect Unit
onChange self fn = runFn2 onChangeImpl self (fn <<< (unsafePartial fromRight) <<< runExcept <<< readDocumentEvent)
onChange self fn =
runFn2 onChangeImpl self (fn <<< fromRight <<< runExcept <<< readDocumentEvent)
where
fromRight = either (\_ -> unsafeCrashWith "Expected Left in Ace.Document.onChange") identity

foreign import setValueImpl
:: Fn2 String Document (Effect Unit)
Expand Down