Skip to content

Commit 29fd149

Browse files
committed
trivial Lazy instance for Unit
1 parent 33bcce0 commit 29fd149

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Control/Lazy.purs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Control.Lazy where
22

3-
import Data.Unit (Unit)
3+
import Data.Unit (Unit, unit)
44

55
-- | The `Lazy` class represents types which allow evaluation of values
66
-- | to be _deferred_.
@@ -10,6 +10,9 @@ import Data.Unit (Unit)
1010
class Lazy l where
1111
defer :: (Unit -> l) -> l
1212

13+
instance lazyUnit :: Lazy Unit where
14+
defer _ = unit
15+
1316
-- | `fix` defines a value as the fixed point of a function.
1417
-- |
1518
-- | The `Lazy` instance allows us to generate the result lazily.

0 commit comments

Comments
 (0)