mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
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) }
|
newtype Get a = Get { unGet :: S -> (a, S) }
|
||||||
|
|
||||||
instance Functor Get where
|
instance Functor Get where
|
||||||
fmap f m = Get (\s -> let (a, s') = unGet m s
|
fmap f m = Get (\s -> case unGet m s of
|
||||||
in (f a, s'))
|
(a, s') -> (f a, s'))
|
||||||
{-# INLINE fmap #-}
|
{-# INLINE fmap #-}
|
||||||
|
|
||||||
#ifdef APPLICATIVE_IN_BASE
|
#ifdef APPLICATIVE_IN_BASE
|
||||||
|
|||||||
Reference in New Issue
Block a user