mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-17 06:06:13 +03:00
29 lines
738 B
Diff
29 lines
738 B
Diff
diff -ru3 unlambda-0.1.3-old/Language/Unlambda.hs unlambda-0.1.3/Language/Unlambda.hs
|
|
--- unlambda-0.1.3-old/Language/Unlambda.hs 2015-04-17 21:16:32.415751612 +0300
|
|
+++ unlambda-0.1.3/Language/Unlambda.hs 2015-04-17 21:25:38.210123501 +0300
|
|
@@ -29,6 +29,7 @@
|
|
import Prelude hiding(catch)
|
|
#endif
|
|
import Control.Exception (catch, IOException)
|
|
+import Control.Monad (liftM, ap)
|
|
|
|
------------------------------------------------------------------------
|
|
-- Abstract syntax
|
|
@@ -85,6 +86,16 @@
|
|
|
|
type Cont a = (Maybe Char, Int) -> a -> IO Exp
|
|
|
|
+instance Functor Eval where
|
|
+
|
|
+ fmap = liftM
|
|
+
|
|
+instance Applicative Eval where
|
|
+
|
|
+ pure = return
|
|
+
|
|
+ (<*>) = ap
|
|
+
|
|
instance Monad Eval where
|
|
|
|
(Eval cp1) >>= f = Eval $ \dat1 cont2 ->
|