diff --git a/src/Pretty/Serialize.hs b/src/Pretty/Serialize.hs index 3ef4206..5a7a767 100644 --- a/src/Pretty/Serialize.hs +++ b/src/Pretty/Serialize.hs @@ -57,10 +57,10 @@ type ContinuationSerializer a = (SerializerState -> (SerializerState, a)) type Prepends = [StrictText] -> [StrictText] data SerializerState = SerializerState - { builder :: Prepends - , indentation :: !Indentation + { builder :: Prepends -- this laziness is important + , indentation :: {-# UNPACK #-} !Indentation , increaseIndentation :: !(Indentation -> Indentation) - , currentFieldIndex :: !(Maybe Word) + , currentFieldIndex :: {-# UNPACK #-} !(Maybe Word) } instance Applicative Serializer where