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
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"url": "git://github.com/paf31/purescript-nonempty.git"
},
"dependencies": {
"purescript-foldable-traversable": "^1.0.0"
"purescript-foldable-traversable": "^1.0.0",
"purescript-generics": "^1.0.0"
},
"devDependencies": {
"purescript-console": "^1.0.0",
Expand Down
3 changes: 3 additions & 0 deletions src/Data/NonEmpty.purs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Control.Alternative (class Alternative)
import Control.Plus (class Plus, empty)

import Data.Foldable (class Foldable, foldl, foldr, foldMap)
import Data.Generic (class Generic)
import Data.Traversable (class Traversable, traverse, sequence)

-- | A non-empty container of elements of type a.
Expand Down Expand Up @@ -78,6 +79,8 @@ instance ordNonEmpty :: (Ord a, Ord (f a)) => Ord (NonEmpty f a) where
EQ -> compare fa1 fa2
other -> other

derive instance genericNonEmpty :: (Generic (f a), Generic a) => Generic (NonEmpty f a)

instance functorNonEmpty :: Functor f => Functor (NonEmpty f) where
map f (a :| fa) = f a :| map f fa

Expand Down