From 69e224756514b29a834ad5104c5b1039578c732d Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Sun, 9 Sep 2012 11:59:46 +0200 Subject: [PATCH] CodeGenMonad: add Functor instance --- Harpy/CodeGenMonad.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Harpy/CodeGenMonad.hs b/Harpy/CodeGenMonad.hs index c716b70..94d68a1 100644 --- a/Harpy/CodeGenMonad.hs +++ b/Harpy/CodeGenMonad.hs @@ -173,6 +173,9 @@ instance Monad (CodeGen e s) where fail err = cgFail err m >>= k = cgBind m k +instance Functor (CodeGen e s) where + fmap = liftM + cgReturn :: a -> CodeGen e s a cgReturn x = CodeGen (\_env state -> return (state, Right x)) -- 2.25.1