[Haskell-beginners] Fwd: deep seq and bang patterns

Emmanuel Touzery etouzery at gmail.com
Tue Dec 25 20:00:18 CET 2012


Hello,

On Tue, Dec 25, 2012 at 3:39 PM, Daniel Fischer <
daniel.is.fischer at googlemail.com> wrote:

>
> Defining TvShow with strict fields for title, startTime and summary makes
> sure
> these fields are evaluated (to WHNF, but in case of `Data.Text`, that means
> fully evaluated) **when the TvShow value is evaluated to WHNF**.
>

how do I know what does "evaluated to WHNF" means for every possible type?

For instance, what does that mean for "String"? What does that mean for
"Maybe String"?

If I want the field to be fully evaluated, is !(Maybe String) enough or
should I even do !(Maybe !String) or something more?

Any source of information where I can read about this in depth would be
welcome (I have yet to read Real World Haskell, maybe it's covered there?).

Thank you!

Emmanuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121225/cce4fa9f/attachment.htm>


More information about the Beginners mailing list