File tree 3 files changed +64
-0
lines changed
3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 34
34
join :: forall a m. (Bind m) => m (m a) -> m a
35
35
36
36
37
+ ## Module Control.Comonad
38
+
39
+ ### Type Classes
40
+
41
+ class (Extend w) <= Comonad w where
42
+ extract :: forall a. w a -> a
43
+
44
+
45
+ ## Module Control.Extend
46
+
47
+ ### Type Classes
48
+
49
+ class (Functor w) <= Extend w where
50
+ (<<=) :: forall b a. (w a -> b) -> w a -> w b
51
+
52
+
53
+ ### Type Class Instances
54
+
55
+ instance extendArr :: (Semigroup w) => Extend (Prim.Function w)
56
+
57
+ instance extendArray :: Extend Prim.Array
58
+
59
+
60
+ ### Values
61
+
62
+ (=<=) :: forall b a w c. (Extend w) => (w b -> c) -> (w a -> b) -> w a -> c
63
+
64
+ (=>=) :: forall b a w c. (Extend w) => (w a -> b) -> (w b -> c) -> w a -> c
65
+
66
+ (=>>) :: forall b a w. (Extend w) => w a -> (w a -> b) -> w b
67
+
68
+ duplicate :: forall a w. (Extend w) => w a -> w (w a)
69
+
70
+
37
71
## Module Control.Monad
38
72
39
73
### Values
Original file line number Diff line number Diff line change
1
+ module Control.Comonad where
2
+
3
+ import Control.Extend
4
+
5
+ class (Extend w ) <= Comonad w where
6
+ extract :: forall a . w a -> a
Original file line number Diff line number Diff line change
1
+ module Control.Extend where
2
+
3
+ infixl 1 =>>
4
+ infixr 1 <<=
5
+ infixr 1 =>=
6
+ infixr 1 =<=
7
+
8
+ class (Functor w ) <= Extend w where
9
+ (<<=) :: forall b a . (w a -> b ) -> w a -> w b
10
+
11
+ instance extendArr :: (Semigroup w ) => Extend ((-> ) w ) where
12
+ (<<=) f g w = f \w' -> g (w <> w')
13
+
14
+ (=>>) :: forall b a w . (Extend w ) => w a -> (w a -> b ) -> w b
15
+ (=>>) w f = f <<= w
16
+
17
+ (=>=) :: forall b a w c . (Extend w ) => (w a -> b ) -> (w b -> c ) -> w a -> c
18
+ (=>=) f g w = g (f <<= w)
19
+
20
+ (=<=) :: forall b a w c . (Extend w ) => (w b -> c ) -> (w a -> b ) -> w a -> c
21
+ (=<=) f g w = f (g <<= w)
22
+
23
+ duplicate :: forall a w . (Extend w ) => w a -> w (w a )
24
+ duplicate w = id <<= w
You can’t perform that action at this time.
0 commit comments