mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 15:41:48 +00:00
haskell-options: Fix for 7.10.1
This commit is contained in:
parent
872f8c0431
commit
c972ea1e8c
@ -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;
|
||||
|
34
pkgs/development/haskell-modules/patches/options-amp.patch
Normal file
34
pkgs/development/haskell-modules/patches/options-amp.patch
Normal file
@ -0,0 +1,34 @@
|
||||
commit 1a2f65b97199bd69ef8f0cebcb8f58de5b26af1c
|
||||
Author: Shea Levy <shea@shealevy.com>
|
||||
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)
|
Loading…
Reference in New Issue
Block a user