Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 3a63680

Browse files
committed
Update to and for PureScript 0.11
1 parent e461fa9 commit 3a63680

File tree

12 files changed

+184
-187
lines changed

12 files changed

+184
-187
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gulp-purescript",
33
"private": true,
44
"dependencies": {
5-
"purescript-aff": "~0.17.0",
6-
"purescript-foreign": "~1.0.0"
5+
"purescript-aff": "~3.0.0",
6+
"purescript-foreign": "~4.0.0"
77
}
88
}

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,30 @@
1717
"output"
1818
],
1919
"scripts": {
20-
"psc": "psc 'src/**/*.purs' 'bower_components/purescript-*/src/**/*.purs'",
20+
"psc": "purs compile 'src/**/*.purs' 'bower_components/purescript-*/src/**/*.purs'",
2121
"test": "npm run psc && (node test/test.js | tap-spec)",
22-
"prepublish": "rm -r output && npm run psc"
22+
"prepublish": "rimraf output && npm run psc"
2323
},
2424
"keywords": [
2525
"gulpplugin",
2626
"purescript"
2727
],
2828
"dependencies": {
29-
"async": "^2.0.0-rc.5",
30-
"camelcase": "^3.0.0",
31-
"cross-spawn": "^4.0.0",
32-
"glob": "^7.0.3",
33-
"gulp-util": "^3.0.7",
29+
"async": "^2.3.0",
30+
"camelcase": "^4.1.0",
31+
"cross-spawn": "^5.1.0",
32+
"glob": "^7.1.1",
33+
"gulp-util": "^3.0.8",
3434
"logalot": "^2.1.0",
3535
"resolve-bin": "^0.4.0",
36-
"which": "^1.2.9"
36+
"which": "^1.2.14"
3737
},
3838
"devDependencies": {
3939
"gulp": "^3.9.1",
40-
"purescript": "^0.9.1-rc.1",
40+
"purescript": "^0.11.4",
41+
"rimraf": "^2.6.1",
4142
"tap-spec": "^4.1.1",
42-
"tape": "^4.5.1",
43-
"through2": "^2.0.1"
43+
"tape": "^4.6.3",
44+
"through2": "^2.0.3"
4445
}
4546
}

src/GulpPurescript/ChildProcess.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ module GulpPurescript.ChildProcess
66
import Prelude
77

88
import Control.Monad.Aff (Aff, makeAff)
9-
import Control.Monad.Eff (Eff)
9+
import Control.Monad.Eff (Eff, kind Effect)
1010
import Control.Monad.Eff.Exception (Error)
1111

1212
import Data.Function.Uncurried (Fn4, runFn4)
1313

14-
foreign import data ChildProcess :: !
14+
foreign import data ChildProcess :: Effect
1515

1616
spawn :: forall eff. String -> Array String -> Aff (cp :: ChildProcess | eff) String
1717
spawn command args = makeAff $ runFn4 spawnFn command args

src/GulpPurescript/Glob.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ module GulpPurescript.Glob
77
import Prelude (Unit, ($))
88

99
import Control.Monad.Aff (Aff, makeAff)
10-
import Control.Monad.Eff (Eff)
10+
import Control.Monad.Eff (Eff, kind Effect)
1111
import Control.Monad.Eff.Exception (Error)
1212

1313
import Data.Function.Uncurried (Fn3, runFn3)
1414

15-
foreign import data Glob :: !
15+
foreign import data Glob :: Effect
1616

1717
glob :: forall eff. String -> Aff (glob :: Glob | eff) (Array String)
1818
glob pattern = makeAff $ runFn3 globFn pattern

src/GulpPurescript/Logalot.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module GulpPurescript.Logalot
55

66
import Prelude (Unit)
77

8-
import Control.Monad.Eff (Eff)
8+
import Control.Monad.Eff (Eff, kind Effect)
99

10-
foreign import data Logalot :: !
10+
foreign import data Logalot :: Effect
1111

1212
foreign import info :: forall eff. String -> Eff (logalot :: Logalot | eff) Unit

src/GulpPurescript/OS.purs

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,35 @@ module GulpPurescript.OS
44
, platform
55
) where
66

7-
import Prelude (class Show, (<$>), (<>), const)
7+
import Prelude
88

9-
import Control.Monad.Eff (Eff)
9+
import Control.Monad.Eff (Eff, kind Effect)
1010
import Control.Monad.Eff.Exception.Unsafe (unsafeThrow)
11+
import Control.Monad.Except (runExcept)
1112

1213
import Data.Either (either)
13-
import Data.Foreign (Foreign)
14-
import Data.Foreign.Class (class IsForeign, read)
14+
import Data.Foreign (F, Foreign, readString)
1515
import Data.Maybe (Maybe(..))
1616

17-
foreign import data OS :: !
17+
foreign import data OS :: Effect
1818

1919
data Platform = Darwin | Linux | Win32
2020

2121
instance showPlatform :: Show Platform where
22-
show a = case a of
23-
Darwin -> "darwin"
24-
Linux -> "linux"
25-
Win32 -> "win32"
26-
27-
instance isForeignPlatform :: IsForeign Platform where
28-
read a = (\a -> case a of
29-
"darwin" -> Darwin
30-
"linux" -> Linux
31-
"win32" -> Win32
32-
_ -> unsafeThrow ("Unhandled platform: " <> a)) <$> read a
22+
show = case _ of
23+
Darwin -> "darwin"
24+
Linux -> "linux"
25+
Win32 -> "win32"
26+
27+
readPlatform :: Foreign -> F Platform
28+
readPlatform =
29+
readString >=> case _ of
30+
"darwin" -> pure Darwin
31+
"linux" -> pure Linux
32+
"win32" -> pure Win32
33+
a -> unsafeThrow ("Unhandled platform: " <> a)
3334

3435
platform :: forall eff. Eff (os :: OS | eff) (Maybe Platform)
35-
platform = either (const Nothing) Just <$> read <$> platformFn
36+
platform = either (const Nothing) Just <$> runExcept <$> readPlatform <$> platformFn
3637

3738
foreign import platformFn :: forall eff. Eff (os :: OS | eff) Foreign

0 commit comments

Comments
 (0)