File tree Expand file tree Collapse file tree 6 files changed +121
-1
lines changed Expand file tree Collapse file tree 6 files changed +121
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Module Documentation
2
2
3
+ ## Module Control.Alt
4
+
5
+ ### Type Classes
6
+
7
+ class (Functor f) <= Alt f where
8
+ (<|>) :: forall a. f a -> f a -> f a
9
+
10
+
11
+ ## Module Control.Alternative
12
+
13
+ ### Type Classes
14
+
15
+ class (Applicative f, Plus f) <= Alternative f where
16
+
17
+
18
+ ### Values
19
+
20
+ many :: forall f a. (Alternative f, Lazy1 f) => f a -> f [a]
21
+
22
+ some :: forall f a. (Alternative f, Lazy1 f) => f a -> f [a]
23
+
24
+
3
25
## Module Control.Apply
4
26
5
27
### Values
34
56
join :: forall a m. (Bind m) => m (m a) -> m a
35
57
36
58
59
+ ## Module Control.Lazy
60
+
61
+ ### Type Classes
62
+
63
+ class Lazy l where
64
+ defer :: (Unit -> l) -> l
65
+
66
+ class Lazy1 l where
67
+ defer1 :: forall a. (Unit -> l a) -> l a
68
+
69
+ class Lazy2 l where
70
+ defer2 :: forall a b. (Unit -> l a b) -> l a b
71
+
72
+
73
+ ### Values
74
+
75
+ fix :: forall l a. (Lazy l) => (l -> l) -> l
76
+
77
+ fix1 :: forall l a. (Lazy1 l) => (l a -> l a) -> l a
78
+
79
+ fix2 :: forall l a b. (Lazy2 l) => (l a b -> l a b) -> l a b
80
+
81
+
37
82
## Module Control.Monad
38
83
39
84
### Values
44
89
45
90
unless :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
46
91
47
- when :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
92
+ when :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
93
+
94
+
95
+ ## Module Control.MonadPlus
96
+
97
+ ### Type Classes
98
+
99
+ class (Monad m, Alternative m) <= MonadPlus m where
100
+
101
+
102
+ ### Values
103
+
104
+ guard :: forall m. (MonadPlus m) => Boolean -> m Unit
105
+
106
+
107
+ ## Module Control.Plus
108
+
109
+ ### Type Classes
110
+
111
+ class (Alt f) <= Plus f where
112
+ empty :: forall a. f a
Original file line number Diff line number Diff line change
1
+ module Control.Alt where
2
+
3
+ infixl 3 <|>
4
+
5
+ class (Functor f ) <= Alt f where
6
+ (<|>) :: forall a . f a -> f a -> f a
Original file line number Diff line number Diff line change
1
+ module Control.Alternative where
2
+
3
+ import Control.Alt
4
+ import Control.Lazy
5
+ import Control.Plus
6
+
7
+ class (Applicative f , Plus f ) <= Alternative f
8
+
9
+ some :: forall f a . (Alternative f , Lazy1 f ) => f a -> f [a ]
10
+ some v = (:) <$> v <*> defer1 (\_ -> many v)
11
+
12
+ many :: forall f a . (Alternative f , Lazy1 f ) => f a -> f [a ]
13
+ many v = some v <|> pure []
14
+
Original file line number Diff line number Diff line change
1
+ module Control.Lazy where
2
+
3
+ class Lazy l where
4
+ defer :: (Unit -> l ) -> l
5
+
6
+ class Lazy1 l where
7
+ defer1 :: forall a . (Unit -> l a ) -> l a
8
+
9
+ class Lazy2 l where
10
+ defer2 :: forall a b . (Unit -> l a b ) -> l a b
11
+
12
+ fix :: forall l a . (Lazy l ) => (l -> l ) -> l
13
+ fix f = defer (\_ -> f (fix f))
14
+
15
+ fix1 :: forall l a . (Lazy1 l ) => (l a -> l a ) -> l a
16
+ fix1 f = defer1 (\_ -> f (fix1 f))
17
+
18
+ fix2 :: forall l a b . (Lazy2 l ) => (l a b -> l a b ) -> l a b
19
+ fix2 f = defer2 (\_ -> f (fix2 f))
Original file line number Diff line number Diff line change
1
+ module Control.MonadPlus where
2
+
3
+ import Control.Alternative
4
+ import Control.Plus
5
+
6
+ class (Monad m , Alternative m ) <= MonadPlus m
7
+
8
+ guard :: forall m . (MonadPlus m ) => Boolean -> m Unit
9
+ guard true = return unit
10
+ guard false = empty
Original file line number Diff line number Diff line change
1
+ module Control.Plus where
2
+
3
+ import Control.Alt
4
+
5
+ class (Alt f ) <= Plus f where
6
+ empty :: forall a . f a
You can’t perform that action at this time.
0 commit comments