1
0
forked from GitHub/gf-core

define return in terms of pure, >> as *>, mappend as <>

In preparation for deprecation, see https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid and https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
This commit is contained in:
Inari Listenmaa
2024-09-09 19:43:39 +02:00
parent 1037b209ae
commit b914a25de3
12 changed files with 30 additions and 28 deletions

View File

@@ -127,11 +127,11 @@ instance Functor Get where
{-# INLINE fmap #-}
instance Applicative Get where
pure = return
pure a = Get (\s -> (a, s))
(<*>) = ap
instance Monad Get where
return a = Get (\s -> (a, s))
return = pure
{-# INLINE return #-}
m >>= k = Get (\s -> case unGet m s of