forked from purescript/purescript-control
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonadPlus.purs
More file actions
32 lines (28 loc) · 1.11 KB
/
Copy pathMonadPlus.purs
File metadata and controls
32 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module Control.MonadPlus
( class MonadPlus
, module Control.Alt
, module Control.Alternative
, module Control.Applicative
, module Control.Apply
, module Control.Bind
, module Control.Monad
, module Control.Plus
, module Data.Functor
) where
import Control.Alt (class Alt, alt, (<|>))
import Control.Alternative (class Alternative, guard)
import Control.Applicative (class Applicative, pure, liftA1, unless, when)
import Control.Apply (class Apply, apply, (*>), (<*), (<*>))
import Control.Bind (class Bind, bind, ifM, join, (<=<), (=<<), (>=>), (>>=))
import Control.Monad (class Monad, ap, liftM1)
import Control.Plus (class Plus, empty)
import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>))
-- | The `MonadPlus` type class has no members of its own; it just specifies
-- | that the type has both `Monad` and `Alternative` instances.
-- |
-- | Types which have `MonadPlus` instances should also satisfy the following
-- | law:
-- |
-- | - Distributivity: `(x <|> y) >>= f == (x >>= f) <|> (y >>= f)`
class (Monad m, Alternative m) <= MonadPlus m
instance monadPlusArray :: MonadPlus Array