Skip to content

Commit

Permalink
Merge pull request #53 from masaeedu/newtypealternate
Browse files Browse the repository at this point in the history
Add newtype instance for Alternate
  • Loading branch information
garyb authored Sep 5, 2019
2 parents 8af53ee + c25cd66 commit 05d40c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"package.json"
],
"dependencies": {
"purescript-prelude": "^4.0.0"
"purescript-prelude": "^4.0.0",
"purescript-newtype": "^3.0.0"
},
"devDependencies": {
"purescript-effect": "^2.0.0"
Expand Down
3 changes: 3 additions & 0 deletions src/Data/Monoid/Alternate.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Prelude
import Control.Alternative (class Alt, class Plus, class Alternative, empty, (<|>))
import Control.Comonad (class Comonad, class Extend)
import Data.Eq (class Eq1)
import Data.Newtype (class Newtype)
import Data.Ord (class Ord1)

-- | Monoid and semigroup instances corresponding to `Plus` and `Alt` instances
Expand All @@ -16,6 +17,8 @@ import Data.Ord (class Ord1)
-- | ```
newtype Alternate f a = Alternate (f a)

derive instance newtypeAlternate :: Newtype (Alternate f a) _

derive newtype instance eqAlternate :: Eq (f a) => Eq (Alternate f a)

derive newtype instance eq1Alternate :: Eq1 f => Eq1 (Alternate f)
Expand Down

0 comments on commit 05d40c5

Please sign in to comment.