File tree 6 files changed +121
-3
lines changed
6 files changed +121
-3
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
54
76
55
77
instance extendArr :: (Semigroup w) => Extend (Prim.Function w)
56
78
57
- instance extendArray :: Extend Prim.Array
58
-
59
79
60
80
### Values
61
81
68
88
duplicate :: forall a w. (Extend w) => w a -> w (w a)
69
89
70
90
91
+ ## Module Control.Lazy
92
+
93
+ ### Type Classes
94
+
95
+ class Lazy l where
96
+ defer :: (Unit -> l) -> l
97
+
98
+ class Lazy1 l where
99
+ defer1 :: forall a. (Unit -> l a) -> l a
100
+
101
+ class Lazy2 l where
102
+ defer2 :: forall a b. (Unit -> l a b) -> l a b
103
+
104
+
105
+ ### Values
106
+
107
+ fix :: forall l a. (Lazy l) => (l -> l) -> l
108
+
109
+ fix1 :: forall l a. (Lazy1 l) => (l a -> l a) -> l a
110
+
111
+ fix2 :: forall l a b. (Lazy2 l) => (l a b -> l a b) -> l a b
112
+
113
+
71
114
## Module Control.Monad
72
115
73
116
### Values
78
121
79
122
unless :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
80
123
81
- when :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
124
+ when :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
125
+
126
+
127
+ ## Module Control.MonadPlus
128
+
129
+ ### Type Classes
130
+
131
+ class (Monad m, Alternative m) <= MonadPlus m where
132
+
133
+
134
+ ### Values
135
+
136
+ guard :: forall m. (MonadPlus m) => Boolean -> m Unit
137
+
138
+
139
+ ## Module Control.Plus
140
+
141
+ ### Type Classes
142
+
143
+ class (Alt f) <= Plus f where
144
+ 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