forked from GitHub/gf-core
make the Functor Get instance in Data.Binary strict to be sure that the decoder is strict
This commit is contained in:
@@ -108,8 +108,8 @@ data S = S {-# UNPACK #-} !B.ByteString -- current chunk
|
||||
newtype Get a = Get { unGet :: S -> (a, S) }
|
||||
|
||||
instance Functor Get where
|
||||
fmap f m = Get (\s -> let (a, s') = unGet m s
|
||||
in (f a, s'))
|
||||
fmap f m = Get (\s -> case unGet m s of
|
||||
(a, s') -> (f a, s'))
|
||||
{-# INLINE fmap #-}
|
||||
|
||||
#ifdef APPLICATIVE_IN_BASE
|
||||
|
||||
Reference in New Issue
Block a user