Commit 5825786e authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add instance Functor Q and make Quasi require Functor

parent 79191100
......@@ -57,7 +57,7 @@ import System.IO ( hPutStrLn, stderr )
--
-----------------------------------------------------
class Monad m => Quasi m where
class (Monad m, Functor m) => Quasi m where
-- Fresh names
qNewName :: String -> m Name
......@@ -127,6 +127,9 @@ instance Monad Q where
Q m >> Q n = Q (m >> n)
fail s = Q (fail s)
instance Functor Q where
fmap f (Q x) = Q (fmap f x)
----------------------------------------------------
-- Packaged versions for the programmer, hiding the Quasi-ness
newName :: String -> Q Name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment