summaryrefslogtreecommitdiff
path: root/compiler/utils/Maybes.hs
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2019-06-08 20:48:07 +0200
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2019-06-09 14:35:50 +0200
commit4c44e323e8ac0e28e87e93ab53cbf7eb21ac9c25 (patch)
treeb0991218e9cac8f76224df017856045c71d779e4 /compiler/utils/Maybes.hs
parent8754002973dcde8709458044e541ddc8f4fcf6bb (diff)
downloadhaskell-wip/derive-functor.tar.gz
Use DeriveFunctor throughout the codebase (#15654)wip/derive-functor
Diffstat (limited to 'compiler/utils/Maybes.hs')
-rw-r--r--compiler/utils/Maybes.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/utils/Maybes.hs b/compiler/utils/Maybes.hs
index 14bc46b9b8..37acb25a1a 100644
--- a/compiler/utils/Maybes.hs
+++ b/compiler/utils/Maybes.hs
@@ -1,5 +1,6 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
@@ -95,9 +96,7 @@ tryMaybeT action = MaybeT $ catch (Just `fmap` action) handler
-}
data MaybeErr err val = Succeeded val | Failed err
-
-instance Functor (MaybeErr err) where
- fmap = liftM
+ deriving (Functor)
instance Applicative (MaybeErr err) where
pure = Succeeded