On Mon, Sep 3, 2012 at 11:18 AM, Felipe Almeida Lessa
<felipe.le...@gmail.com> wrote:
> Ditto for oldLen here.  Also, you can simplify this lambda a lot:
>
>   import Control.Applicative ((<$>))
>
>   \(oldLen, oldVal) ->
>     let newLen = oldLen + 1
>         newVal = (number:) <$> oldVal
>     in newLen `seq` newVal `seq` (newLen, newVal)

Or, using BangPatterns,

  \(oldLen, oldVal) ->
    let !newLen = oldLen + 1
        !newVal = (number:) <$> oldVal
    in (newLen, newVal)

Cheers,

-- 
Felipe.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to