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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Type Class Instances

instance altArray :: Alt Prim.Array

instance alternativeArray :: Alternative Prim.Array

instance applicativeArray :: Applicative Prim.Array
Expand All @@ -16,6 +18,10 @@

instance monadArray :: Monad Prim.Array

instance monadPlusArray :: MonadPlus Prim.Array

instance plusArray :: Plus Prim.Array

instance semigroupArray :: Semigroup [a]


Expand Down
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"package.json"
],
"dependencies": {
"purescript-maybe": "*"
"purescript-maybe": "~0.2.0",
"purescript-control": "~0.2.0"
}
}
14 changes: 12 additions & 2 deletions src/Data/Array.purs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ module Data.Array
, span
) where

import Control.Alt
import Control.Plus
import Control.Alternative
import Control.MonadPlus
import Data.Maybe
import Prelude.Unsafe (unsafeIndex)

Expand Down Expand Up @@ -363,6 +367,12 @@ instance monadArray :: Monad []
instance semigroupArray :: Semigroup [a] where
(<>) = append

instance alternativeArray :: Alternative [] where
empty = []
instance altArray :: Alt [] where
(<|>) = append

instance plusArray :: Plus [] where
empty = []

instance alternativeArray :: Alternative []

instance monadPlusArray :: MonadPlus []