diff --git a/pkgs/development/haskell-modules/configuration-ghc-7.9.x.nix b/pkgs/development/haskell-modules/configuration-ghc-7.9.x.nix index 8e9c23414aa..c3f9dae52f3 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-7.9.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-7.9.x.nix @@ -58,6 +58,14 @@ self: super: { utf8-string = overrideCabal super.utf8-string (drv: { patchPhase = "sed -i -e 's|base >= 3 && < 4.8|base|' utf8-string.cabal"; }); + options = overrideCabal super.options (drv: { + # edited cabal file simply makes a stricter base bound + editedCabalFile = null; + + # See https://github.com/shlevy/haskell-options/tree/AMP. There is no + # official upstream bugtracker but I've emailed this patch to the maintainer + patches = [ ./patches/options-amp.patch ]; + }); # bos/attoparsec#92 attoparsec = dontCheck super.attoparsec; diff --git a/pkgs/development/haskell-modules/patches/options-amp.patch b/pkgs/development/haskell-modules/patches/options-amp.patch new file mode 100644 index 00000000000..cd50aaf0f0e --- /dev/null +++ b/pkgs/development/haskell-modules/patches/options-amp.patch @@ -0,0 +1,34 @@ +commit 1a2f65b97199bd69ef8f0cebcb8f58de5b26af1c +Author: Shea Levy +Date: Mon Jan 12 08:57:34 2015 -0500 + + Prepare for AMP + + See https://www.haskell.org/haskellwiki/Functor-Applicative-Monad_Proposal + +diff --git a/lib/Options/Tokenize.hs b/lib/Options/Tokenize.hs +index 2ead1ff..91998b6 100644 +--- a/lib/Options/Tokenize.hs ++++ b/lib/Options/Tokenize.hs +@@ -11,6 +11,7 @@ module Options.Tokenize + , tokenize + ) where + ++import Control.Applicative (Applicative(..)) + import Control.Monad.Error hiding (throwError) + import qualified Control.Monad.Error + import Control.Monad.State +@@ -53,6 +54,13 @@ data TokState = TokState + + newtype Tok a = Tok { unTok :: ErrorT String (StateT TokState Identity) a } + ++instance Functor Tok where ++ fmap = liftM ++ ++instance Applicative Tok where ++ pure = return ++ (<*>) = ap ++ + instance Monad Tok where + return = Tok . return + m >>= f = Tok (unTok m >>= unTok . f)