1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00
freebsd-ports/security/hs-cryptol/files/patch-src_Cryptol_Utils_Patterns.hs
Gleb Popov 19c26acbf0 Upgrade lang/ghc to 8.8.3 and many Haskell ports along the way.
PR:		244784
Submitted by:	Evilham <contact@evilham.com> (some ports)
2020-05-04 18:08:10 +00:00

25 lines
756 B
Haskell

--- src/Cryptol/Utils/Patterns.hs.orig 2001-09-09 01:46:40 UTC
+++ src/Cryptol/Utils/Patterns.hs
@@ -5,6 +5,7 @@
module Cryptol.Utils.Patterns where
import Control.Monad(liftM,liftM2,ap,MonadPlus(..),guard)
+import qualified Control.Monad.Fail as Fail
import Control.Applicative(Alternative(..))
newtype Match b = Match (forall r. r -> (b -> r) -> r)
@@ -17,10 +18,12 @@ instance Applicative Match where
(<*>) = ap
instance Monad Match where
- fail _ = empty
Match m >>= f = Match $ \no yes -> m no $ \a ->
let Match n = f a in
n no yes
+
+instance Fail.MonadFail Match where
+ fail _ = empty
instance Alternative Match where
empty = Match $ \no _ -> no