diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2019-06-08 20:48:07 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2019-06-09 14:35:50 +0200 |
commit | 4c44e323e8ac0e28e87e93ab53cbf7eb21ac9c25 (patch) | |
tree | b0991218e9cac8f76224df017856045c71d779e4 /compiler/cmm/Hoopl/Block.hs | |
parent | 8754002973dcde8709458044e541ddc8f4fcf6bb (diff) | |
download | haskell-wip/derive-functor.tar.gz |
Use DeriveFunctor throughout the codebase (#15654)wip/derive-functor
Diffstat (limited to 'compiler/cmm/Hoopl/Block.hs')
-rw-r--r-- | compiler/cmm/Hoopl/Block.hs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/cmm/Hoopl/Block.hs b/compiler/cmm/Hoopl/Block.hs index c4ff1794e8..5c31932934 100644 --- a/compiler/cmm/Hoopl/Block.hs +++ b/compiler/cmm/Hoopl/Block.hs @@ -1,7 +1,9 @@ +{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE StandaloneDeriving #-} module Hoopl.Block ( C , O @@ -64,14 +66,8 @@ data MaybeC ex t where JustC :: t -> MaybeC C t NothingC :: MaybeC O t - -instance Functor (MaybeO ex) where - fmap _ NothingO = NothingO - fmap f (JustO a) = JustO (f a) - -instance Functor (MaybeC ex) where - fmap _ NothingC = NothingC - fmap f (JustC a) = JustC (f a) +deriving instance Functor (MaybeO ex) +deriving instance Functor (MaybeC ex) -- ----------------------------------------------------------------------------- -- The Block type |