Implict parameters and monomorphism
C.Reinke
C.Reinke@ukc.ac.uk
Thu, 03 May 2001 14:46:44 +0100
> But most importantly, this was a bad example. There was a much better
> one posted on this mailing list a while ago. Does anyone remember it?
>
> -- Lennart
Perhaps I should mention a useful application of this game, somewhat
unhelpfully named "Representative thingies" in my Haskell corner:
http://www.cs.ukc.ac.uk/people/staff/cr3/toolbox/haskell/
Load the file R.hs in your favourite Hugs (Hugs mode), and you'll
see things like this (see comments in R.hs for more examples):
Main> foldl (+) 0 [1..4] :: Int
10
Main> foldr (+) 0 [1..4] :: Int
10
Main> foldl (+) 0 [1..4]
((((0 + 1) + 2) + 3) + 4)
Main> foldr (+) 0 [1..4]
(1 + (2 + (3 + (4 + 0))))
Well, I found it useful (and fun; just a pity that you can't overload
(implicit) application in Haskell;-)..
Claus