How to force strict evaluation of a sequence of ByteString
问题 I have the following Haskell type definition: import Data.Sequence(Seq, length) import Data.ByteString.UTF8(ByteString) type StringSeq = Seq ByteString I have expressions of type StringSeq for which I would like to force strict evaluation with deepseq . So I need to define instances of NFData . I did the following: import Control.DeepSeq(NFData, deepseq) instance NFData ByteString instance NFData a => NFData (Seq a) where rnf s = rnf (length s) So I compute the length of a sequence to force