File tree Expand file tree Collapse file tree 2 files changed +32
-8
lines changed Expand file tree Collapse file tree 2 files changed +32
-8
lines changed Original file line number Diff line number Diff line change 60
60
61
61
### Type Classes
62
62
63
- class Lazy a where
64
- defer :: (Unit -> a ) -> a
63
+ class Lazy l where
64
+ defer :: (Unit -> l ) -> l
65
65
66
- class Lazy1 a where
67
- defer1 :: forall b. (Unit -> a b) -> a b
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
68
80
69
81
70
82
## Module Control.Monad
Original file line number Diff line number Diff line change 1
1
module Control.Lazy where
2
2
3
- class Lazy a where
4
- defer :: (Unit -> a ) -> a
3
+ class Lazy l where
4
+ defer :: (Unit -> l ) -> l
5
5
6
- class Lazy1 a where
7
- defer1 :: forall b . (Unit -> a b ) -> a b
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))
You can’t perform that action at this time.
0 commit comments