Skip to content
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: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
dist: trusty
sudo: required
node_js: 6
node_js: stable
env:
- PATH=$HOME/purescript:$PATH
install:
Expand Down
12 changes: 6 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"package.json"
],
"dependencies": {
"purescript-monoid": "^2.0.0"
"purescript-monoid": "^3.0.0"
},
"devDependencies": {
"purescript-arrays": "^2.0.0",
"purescript-console": "^2.0.0",
"purescript-exceptions": "^2.0.0",
"purescript-foldable-traversable": "^2.0.0",
"purescript-tuples": "^3.0.0"
"purescript-arrays": "^4.0.0",
"purescript-console": "^3.0.0",
"purescript-exceptions": "^3.0.0",
"purescript-foldable-traversable": "^3.0.0",
"purescript-tuples": "^4.0.0"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"private": true,
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "pulp build --censor-lib --strict",
"build": "pulp build -- --censor-lib --strict",
"test": "pulp test"
},
"devDependencies": {
"pulp": "^9.0.1",
"purescript-psa": "^0.3.9",
"rimraf": "^2.5.0"
"pulp": "^10.0.4",
"purescript-psa": "^0.5.0-rc.1",
"rimraf": "^2.6.1"
}
}
24 changes: 8 additions & 16 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import Data.Ord.Max (Max(..))
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested (Tuple3, tuple3, uncurry3)

type EffT a = forall eff. Eff (err :: EXCEPTION, console :: CONSOLE | eff) a
type EffT a = forall eff. Eff (exception :: EXCEPTION, console :: CONSOLE | eff) a

assertEq :: forall a. (Show a, Eq a) => a -> a -> EffT Unit
assertEq :: forall a. Show a => Eq a => a -> a -> EffT Unit
assertEq x y
| x == y = pure unit
| otherwise = throwException $ error $ show x <> " /= " <> show y
Expand All @@ -41,25 +41,15 @@ main = do
log "Min is a well-behaved Monoid"
identityOf Max

log "clamp"
let f1 = clamp 0 10
assertEq (f1 (-5)) 0
assertEq (f1 5) 5
assertEq (f1 15) 10

log "between"
let f2 = between 0 10
assertEq (f2 (-5)) false
assertEq (f2 5) true
assertEq (f2 15) false

log "top/bottom"
assertEq (fromDown (top :: Down Int)) (bottom :: Int)
assertEq (fromDown (bottom :: Down Int)) (top :: Int)

associativityOf
:: forall a
. (Semigroup a, Eq a, Show a)
. Semigroup a
=> Eq a
=> Show a
=> (Ordering -> a)
-> EffT Unit
associativityOf f =
Expand All @@ -71,7 +61,9 @@ associativityOf f =

identityOf
:: forall a
. (Monoid a, Eq a, Show a)
. Monoid a
=> Eq a
=> Show a
=> (Ordering -> a)
-> EffT Unit
identityOf f =
Expand Down