Is that possible? That I need to combine BOTH deepseq and bang patterns to actually get my code to evaluate when filling in the data? Or am I going crazy?That did not help.Then I tried deepseq:That did not help.At first I tried bang patterns on my record:Now, if nothing else for space usage needs, I need to make this strict.Hello,laziness just gave me some headache now. Because some of my code was evaluated much later, well first the memory use exploded but also I got an error which was really difficult to understand because it manifested much later than I would intuitively expect (when I read the record field, not when I wrote it...).
{-# LANGUAGE BangPatterns #-}
data TvShow = TvShow
{
channel :: Channel,
title :: !T.Text,
startTime :: !T.Text,
summary :: !T.Text
}
deriving (Eq, Show)
instance NFData TvShow
return $!! result
And here's the catch: doing BOTH helps... I mean I think I'll check it again because I find it hard to believe but right now it really seems it behaves like that...
Thank you!
Emmanuel