
13 May
2008
13 May
'08
8:07 p.m.
Hello,
$ 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 -Jeff --- 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.