[Haskell-beginners] Explanation of double astrix
Paul.A.Johnston at manchester.ac.uk
Wed Sep 3 12:00:02 EDT 2008
Was playing around with ghci and lambda expressions and:
*Main> map (\x -> 2 * x) [1 ..3]
Then thinking back to Fortran (yes I'm not young anymore!)
*Main> map (\x -> 2 ** x) [1 ..3]
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.
More information about the Beginners