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: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
- uses: actions/checkout@v2

- uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"

- uses: actions/setup-node@v1
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
## [Unreleased]

Breaking changes:
- Update project and deps to PureScript v0.15.0 (#23 by @JordanMartinez)

New features:

Expand Down
16 changes: 8 additions & 8 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"package.json"
],
"dependencies": {
"purescript-foldable-traversable": "^5.0.0",
"purescript-identity": "^5.0.0",
"purescript-arrays": "^6.0.0",
"purescript-either": "^5.0.0",
"purescript-lists": "^6.0.0",
"purescript-ordered-collections": "^2.0.0"
"purescript-foldable-traversable": "master",
"purescript-identity": "master",
"purescript-arrays": "master",
"purescript-either": "master",
"purescript-lists": "master",
"purescript-ordered-collections": "master"
},
"devDependencies": {
"purescript-assert": "^5.0.0",
"purescript-console": "^5.0.0"
"purescript-assert": "master",
"purescript-console": "master"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build:docs": "rimraf docs && pulp docs"
},
"devDependencies": {
"pulp": "^15.0.0",
"pulp": "16.0.0-0",
"purescript-psa": "^0.8.2",
"rimraf": "^3.0.2"
}
Expand Down
6 changes: 3 additions & 3 deletions src/Data/Filterable.purs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ instance filterableArray :: Filterable Array where
filter = Array.filter

instance filterableMaybe :: Filterable Maybe where
partitionMap p Nothing = { left: Nothing, right: Nothing }
partitionMap _ Nothing = { left: Nothing, right: Nothing }
partitionMap p (Just x) = case p x of
Left a -> { left: Just a, right: Nothing }
Right b -> { left: Nothing, right: Just b }
Expand All @@ -169,14 +169,14 @@ instance filterableMaybe :: Filterable Maybe where
filter p = filterDefault p

instance filterableEither :: Monoid m => Filterable (Either m) where
partitionMap p (Left x) = { left: Left x, right: Left x }
partitionMap _ (Left x) = { left: Left x, right: Left x }
partitionMap p (Right x) = case p x of
Left a -> { left: Right a, right: Left mempty }
Right b -> { left: Left mempty, right: Right b }

partition p = partitionDefault p

filterMap p (Left l) = Left l
filterMap _ (Left l) = Left l
filterMap p (Right r) = case p r of
Nothing -> Left mempty
Just x -> Right x
Expand Down
8 changes: 4 additions & 4 deletions src/Data/Witherable.purs
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,21 @@ instance witherableMap :: Ord k => Witherable (Map.Map k) where
) <$> acc <*> p x

instance witherableMaybe :: Witherable Maybe where
wilt p Nothing = pure { left: Nothing, right: Nothing }
wilt _ Nothing = pure { left: Nothing, right: Nothing }
wilt p (Just x) = map convert (p x) where
convert (Left l) = { left: Just l, right: Nothing }
convert (Right r) = { left: Nothing, right: Just r }

wither p Nothing = pure Nothing
wither _ Nothing = pure Nothing
wither p (Just x) = p x

instance witherableEither :: Monoid m => Witherable (Either m) where
wilt p (Left el) = pure { left: Left el, right: Left el }
wilt _ (Left el) = pure { left: Left el, right: Left el }
wilt p (Right er) = map convert (p er) where
convert (Left l) = { left: Right l, right: Left mempty }
convert (Right r) = { left: Left mempty, right: Right r }

wither p (Left el) = pure (Left el)
wither _ (Left el) = pure (Left el)
wither p (Right er) = map convert (p er) where
convert Nothing = Left mempty
convert (Just r) = Right r