Re: [Haskell] A riddle...

2012-07-16 Thread Felipe Almeida Lessa
On Mon, Jul 16, 2012 at 12:33 PM, Vo Minh Thu wrote: > It seems like the infered type (and thus bounds) is different when you > force the result to be a Color or not. Just give explicit type > signatures and conversion functions. Actually, just *always* give explicit type signatures. Cheers, --

Re: [Haskell] A riddle...

2012-07-16 Thread Christian Hoener zu Siederdissen
Hi, well, rgbliste has type: *Main> :t rgbliste rgbliste :: [(Integer, Integer, Integer)] unless you have farbliste as well, in which case it is: *Main> :t rgbliste rgbliste :: [(GHC.Word.Word16, GHC.Word.Word16, GHC.Word.Word16)] Of course, with NoMonomorphismRestriction, the type becomes:

Re: [Haskell] A riddle...

2012-07-16 Thread Vo Minh Thu
It seems like the infered type (and thus bounds) is different when you force the result to be a Color or not. Just give explicit type signatures and conversion functions. Cheers, Thu 2012/7/16 Andreas Abel : > Today a student came to me with a piece of code that worked it executed by > itself, bu

[Haskell] A riddle...

2012-07-16 Thread Andreas Abel
Today a student came to me with a piece of code that worked it executed by itself, but produced different result in the context of his larger problem. We cut down the example to the following: import Graphics.UI.Gtk -- should produce [(26471,0,65535),... rgbliste = (map (\ i -> let rb = 5