summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeb <unknown>2003-10-06 08:37:59 +0000
committerpeb <unknown>2003-10-06 08:37:59 +0000
commit7aa7a3cf19925b376cb368bd47fed75eaa9d5fea (patch)
treea376d4380c4f3775e6ee3bce078f9ece20b436a1
parent0ac49ec12ffdc8f02e1071eb333f5d2c659ca5b1 (diff)
added Functor instance for Err datatype
-rw-r--r--src/GF/Data/Operations.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/GF/Data/Operations.hs b/src/GF/Data/Operations.hs
index 7110a7ac0..6dd78e1bc 100644
--- a/src/GF/Data/Operations.hs
+++ b/src/GF/Data/Operations.hs
@@ -26,6 +26,10 @@ instance Monad Err where
Ok a >>= f = f a
Bad s >>= f = Bad s
+instance Functor Err where -- added 2/10/2003 by PEB
+ fmap f (Ok a) = Ok (f a)
+ fmap f (Bad s) = Bad s
+
-- analogue of maybe
err :: (String -> b) -> (a -> b) -> Err a -> b
err d f e = case e of