
3 Sep
2008
3 Sep
'08
noon
Hi Was playing around with ghci and lambda expressions and: *Main> map (\x -> 2 * x) [1 ..3] [2,4,6] Then thinking back to Fortran (yes I'm not young anymore!) *Main> map (\x -> 2 ** x) [1 ..3] [2.0,4.0,8.0] Curious as to what is going on. *Main> :t (\x -> 2 ** x) (\x -> 2 ** x) :: (Floating t) => t -> t *Main> :t (\x -> 2 * x) (\x -> 2 * x) :: (Num t) => t -> t Somehow the type has gone from Num to Floating I am using the excellent (IMHO) tutorial by Hal Daume and the book by Graham Hutton but can find no clues. Cheers Paul