[Haskell-cafe] different behaviours with or without putStrLn
Bob Ippolito
bob at redivi.com
Mon Jan 13 00:08:57 UTC 2014
Sure, something along the lines of deepseq . show will probably have the
same effect.
On Sunday, January 12, 2014, Corentin Dupont wrote:
> One question:
> Since it works with putStrLn, can I simulate the behaviour of putStrLn
> without actually... printing anything? As a workaround...
>
>
> On Mon, Jan 13, 2014 at 12:40 AM, Corentin Dupont <
> corentin.dupont at gmail.com <javascript:_e({}, 'cvml',
> 'corentin.dupont at gmail.com');>> wrote:
>
>> I doesn't seems to be easy, either with deepseq-th or deepseq-generic...
>> With deepseq-generic, the derivation of Generic doesn't work because I'm
>> using a GATD.
>> It says *"NewVar must be a vanilla data constructor"*.
>>
>> For deepseq-th, I have this error:
>>
>> *deriveNFData: 'forall' not supported in constructor declaration*
>> I have some complex data constructor...
>>
>>
>> So it looks like both deepseq-th and deepseq-generic are out of the game
>> :((
>>
>>
>>
>>
>> On Mon, Jan 13, 2014 at 12:08 AM, Erik de Castro Lopo <
>> mle+hs at mega-nerd.com <javascript:_e({}, 'cvml', 'mle+hs at mega-nerd.com');>
>> > wrote:
>>
>>> James ‘Twey’ Kay wrote:
>>>
>>> > You can (probably) automatically derive it via Template Haskell using
>>> > the deepseq-th package:
>>> >
>>> > {-# LANGUAGE TemplateHaskell #-}
>>> > import Control.DeepSeq.TH
>>> >
>>> > data MyState = ...
>>> >
>>> > $(deriveNFData ''MyState)
>>>
>>> In most cases where you think
>>>
>>> You should probably try the deepseq-generics package before you try
>>> deepseq-th.
>>>
>>> The generics version was suggested to me by the author of the TH version,
>>> Herbert Valerio Riedel. It seems to be just as fast as the TH version and
>>> doesn't require TH.
>>>
>>> Cheers,
>>> Erik
>>> --
>>> ----------------------------------------------------------------------
>>> Erik de Castro Lopo
>>> http://www.mega-nerd.com/
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org <javascript:_e({}, 'cvml',
>>> 'Haskell-Cafe at haskell.org');>
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140112/c22f896d/attachment-0001.html>
More information about the Haskell-Cafe
mailing list