[Haskell-beginners] lifting to applicative: recomputing an argument each time it is used?

Chaddaï Fouché chaddai.fouche at gmail.com
Sun Sep 9 10:44:32 CEST 2012


On Sun, Sep 9, 2012 at 1:29 AM, Iain Nicol <iain at thenicols.net> wrote:

>
> mixIntersperse :: Gen String -> Gen String -> Gen [String]
> mixIntersperse genSep genWord =
>   sized (sequence . intersperse genSep . (`replicate` genWord))
>
>
Very nice :-) (And stupid of me not to think of creating a list of Gen
directly !)

-- 
Jedaï
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120909/fd7456ec/attachment.htm>


More information about the Beginners mailing list