Skip to content

Commit 5d43a9b

Browse files
justinwooLiamGoodacre
authored andcommitted
updates for 0.12
1 parent 1ec2ef1 commit 5d43a9b

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

bower.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
"package.json"
1919
],
2020
"dependencies": {
21-
"purescript-foldable-traversable": "^3.4.0",
22-
"purescript-identity": "^3.1.0",
23-
"purescript-arrays": "^4.1.2",
24-
"purescript-either": "^3.1.0",
25-
"purescript-lists": "^4.9.0",
26-
"purescript-maps": "^3.4.0"
21+
"purescript-foldable-traversable": "purescript/purescript-foldable-traversable#compiler/0.12",
22+
"purescript-identity": "purescript/purescript-identity#compiler/0.12",
23+
"purescript-arrays": "purescript/purescript-arrays#compiler/0.12",
24+
"purescript-either": "purescript/purescript-either#compiler/0.12",
25+
"purescript-lists": "purescript/purescript-lists#compiler/0.12",
26+
"purescript-ordered-collections": "purescript-ordered-collections#compiler/0.12"
2727
},
2828
"devDependencies": {
29-
"purescript-assert": "^3.0.0",
30-
"purescript-console": "^3.0.0"
29+
"purescript-assert": "purescript/purescript-assert#compiler/0.12",
30+
"purescript-console": "purescript-console#compiler/0.12"
3131
}
3232
}

src/Data/Filterable.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ import Prelude (const, class Ord)
4242
-- | - `filter` - filter a data structure based on a boolean.
4343
-- |
4444
-- | Laws:
45-
-- | - Functor Relation: `filterMap id ≡ compact`
46-
-- | - Functor Identity: `filterMap Just ≡ id`
45+
-- | - Functor Relation: `filterMap identity ≡ compact`
46+
-- | - Functor Identity: `filterMap Just ≡ identity`
4747
-- | - Kleisli Composition: `filterMap (l <=< r) ≡ filterMap l <<< filterMap r`
4848
-- |
4949
-- | - `filter ≡ filterMap <<< maybeBool`
5050
-- | - `filterMap p ≡ filter (isJust <<< p)`
5151
-- |
52-
-- | - Functor Relation: `partitionMap id ≡ separate`
53-
-- | - Functor Identity 1: `_.right <<< partitionMap Right ≡ id`
54-
-- | - Functor Identity 2: `_.left <<< partitionMap Left ≡ id`
52+
-- | - Functor Relation: `partitionMap identity ≡ separate`
53+
-- | - Functor Identity 1: `_.right <<< partitionMap Right ≡ identity`
54+
-- | - Functor Identity 2: `_.left <<< partitionMap Left ≡ identity`
5555
-- |
5656
-- | - `f <<< partition ≡ partitionMap <<< eitherBool` where `f = \{ no, yes } -> { left: no, right: yes }`
5757
-- | - `f <<< partitionMap p ≡ partition (isRight <<< p)` where `f = \{ left, right } -> { no: left, yes: right}`

src/Data/Witherable.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Data.Witherable
1313
) where
1414

1515
import Control.Applicative (class Applicative, pure)
16-
import Control.Category ((<<<), id)
16+
import Control.Category ((<<<), identity)
1717
import Data.Compactable (compact, separate)
1818
import Data.Either (Either(..))
1919
import Data.Filterable (class Filterable)
@@ -89,12 +89,12 @@ traverseByWither f = wither (map Just <<< f)
8989
-- | Partition between `Left` and `Right` values - with effects in `m`.
9090
wilted :: forall t m l r. Witherable t => Applicative m =>
9191
t (m (Either l r)) -> m { left :: t l, right :: t r }
92-
wilted = wilt id
92+
wilted = wilt identity
9393

9494
-- | Filter out all the `Nothing` values - with effects in `m`.
9595
withered :: forall t m x. Witherable t => Applicative m =>
9696
t (m (Maybe x)) -> m (t x)
97-
withered = wither id
97+
withered = wither identity
9898

9999
instance witherableArray :: Witherable Array where
100100
wilt = wiltDefault

test/Main.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module Test.Main where
22

33
import Prelude
44

5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Console (CONSOLE, log)
5+
import Effect (Effect)
6+
import Effect.Console (log)
77
import Data.Compactable (compact, separate)
88
import Data.Either (Either(..))
99
import Data.Filterable (filter, filterMap, partition, partitionMap)
@@ -13,7 +13,7 @@ import Data.Map (fromFoldable) as Map
1313
import Data.Maybe (Maybe(..))
1414
import Data.Tuple.Nested ((/\))
1515
import Data.Witherable (wilt, wither)
16-
import Test.Assert (ASSERT, assert)
16+
import Test.Assert (assert)
1717

1818
testEqNoYes :: a. (Ord a) => { no :: a, yes :: a } -> { no :: a, yes :: a } -> Boolean
1919
testEqNoYes { no: n1, yes: y1 } { no: n2, yes: y2 } =
@@ -23,7 +23,7 @@ testEqLeftRight :: ∀ a. (Ord a) => { left :: a, right :: a } -> { left :: a, r
2323
testEqLeftRight { left: l1, right: r1 } { left: l2, right: r2 } =
2424
l1 == l2 && r1 == r2
2525

26-
testCompactable :: Eff (console :: CONSOLE, assert :: ASSERT) Unit
26+
testCompactable :: Effect Unit
2727
testCompactable = do
2828
log "Test compactableMaybe instance" *> do
2929
let parts1 = separate $ Just ((Left 1) :: Either Int Int)
@@ -84,7 +84,7 @@ testCompactable = do
8484
assert $ parts.left == comparisonMapOdds
8585
assert $ parts.right == comparisonMapEvens
8686

87-
testFilterable :: Eff (console :: CONSOLE, assert :: ASSERT) Unit
87+
testFilterable :: Effect Unit
8888
testFilterable = do
8989
log "Test filterableMaybe instance" *> do
9090
assert $ filterMap pred (Just 6) == Just 60
@@ -120,7 +120,7 @@ testFilterable = do
120120
where
121121
pred x = if x > 5 then Just (x * 10) else Nothing
122122

123-
testWitherable :: Eff (console :: CONSOLE, assert :: ASSERT) Unit
123+
testWitherable :: Effect Unit
124124
testWitherable = do
125125
log "Test witherableMaybe instance" *> do
126126
assert $ map _.right (wilt predE (Just 6)) == Identity (Just 60)
@@ -173,7 +173,7 @@ testWitherable = do
173173
predM x = if x > 5 then Identity (Just (x * 10)) else Identity Nothing
174174
predE x = if x > 5 then Identity (Right (x * 10)) else Identity (Left x)
175175

176-
main :: Eff (console :: CONSOLE, assert :: ASSERT) Unit
176+
main :: Effect Unit
177177
main = do
178178
testCompactable
179179
testFilterable

0 commit comments

Comments
 (0)