diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2018-11-10 01:12:52 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-03-22 10:34:51 -0400 |
commit | ab51bee40c82cd552bcf13e24b67d43f3b8d25f3 (patch) | |
tree | a75a4102576dad50af44e342fb9152e7270792eb /testsuite/tests/determinism | |
parent | cd07086ada34888c08585f4dc98a961618748ed0 (diff) | |
download | haskell-ab51bee40c82cd552bcf13e24b67d43f3b8d25f3.tar.gz |
base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` instead
As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail
Coauthored-by: Ben Gamari <ben@well-typed.com>
Diffstat (limited to 'testsuite/tests/determinism')
-rw-r--r-- | testsuite/tests/determinism/determ017/A.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/determinism/determ021/determ021.stdout | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/testsuite/tests/determinism/determ017/A.hs b/testsuite/tests/determinism/determ017/A.hs index 5e3c3d0809..082c9380de 100644 --- a/testsuite/tests/determinism/determ017/A.hs +++ b/testsuite/tests/determinism/determ017/A.hs @@ -20,7 +20,7 @@ -- | Module "Trampoline" defines the pipe computations and their basic building blocks. {-# LANGUAGE ScopedTypeVariables, Rank2Types, MultiParamTypeClasses, - TypeFamilies, KindSignatures, FlexibleContexts, NoMonadFailDesugaring, + TypeFamilies, KindSignatures, FlexibleContexts, FlexibleInstances, OverlappingInstances, UndecidableInstances #-} @@ -81,6 +81,9 @@ instance Monad Identity where return a = Identity a m >>= k = k (runIdentity m) +instance MonadFail Identity where + fail = error "Identity(fail)" + newtype Trampoline m s r = Trampoline {bounce :: m (TrampolineState m s r)} data TrampolineState m s r = Done r | Suspend! (s (Trampoline m s r)) @@ -97,6 +100,9 @@ instance (Monad m, Functor s) => Monad (Trampoline m s) where where apply f (Done x) = bounce (f x) apply f (Suspend s) = return (Suspend (fmap (>>= f) s)) +instance (MonadFail m, Functor s) => MonadFail (Trampoline m s) where + fail = error "Trampoline(fail)" + data Yield x y = Yield! x y instance Functor (Yield x) where fmap f (Yield x y) = trace "fmap yield" $ Yield x (f y) diff --git a/testsuite/tests/determinism/determ021/determ021.stdout b/testsuite/tests/determinism/determ021/determ021.stdout index d0a002bc9a..a39bc192bb 100644 --- a/testsuite/tests/determinism/determ021/determ021.stdout +++ b/testsuite/tests/determinism/determ021/determ021.stdout @@ -5,7 +5,7 @@ TYPE SIGNATURES (Applicative f, Num t, Num b) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3, +Dependent packages: [base-4.13.0.0, ghc-prim-0.5.3, integer-gmp-1.0.2.0] [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES @@ -14,5 +14,5 @@ TYPE SIGNATURES (Applicative f, Num t, Num b) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3, +Dependent packages: [base-4.13.0.0, ghc-prim-0.5.3, integer-gmp-1.0.2.0] |