[Haskell-cafe] GHC predictability

Jeff Polakow jeff.polakow at db.com
Tue May 13 16:07:01 EDT 2008


>  > $ pointfree "\xs -> foldl' (+) 0 xs / fromIntegral (length xs)"
>  > ap ((/) . foldl' (+) 0) (fromIntegral . length)
This will have the same space usage as the pointed version. You can see 
this by looking at the monad instance for ((->) r):

    instance Monad ((->) r) where
        return = const
        f >>= k = \ r -> k (f r) r



This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080513/d7de38a9/attachment.htm

More information about the Haskell-Cafe mailing list