[Haskell-beginners] reverse [1..]
Kim-Ee Yeoh
ky3 at atamo.com
Tue Dec 18 17:34:24 CET 2012
Emanuel: I was trying to build infinite list from -inf to +inf.
Bob: What would you expect the number after -inf to be?
Wait a minute, let's just talk about the head of the list. What type is the
list element? Int? Integer? If Int, there's minBound :: Bounded Int => Int.
If Integer, no such instance exists!
So perhaps you want [minBound .. maxBound] :: [Int]?
-- Kim-Ee
On Tue, Dec 18, 2012 at 10:16 PM, Tom Davie <tom.davie at gmail.com> wrote:
>
> On 18 Dec 2012, at 14:35, Emanuel Koczwara <poczta at emanuelkoczwara.pl>
> wrote:
>
> > Hi,
> >
> > Dnia 2012-12-18, wto o godzinie 20:30 +0600, Alexander _ pisze:
> >> Hello,
> >>
> >>
> >>
> >> Here you try to reverse infinite list. What do you expect to get?
> >>
> >
> > I was trying to build infinite list from -inf to +inf.
>
> What would you expect the number after -inf to be?
>
> Bob
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121218/81027e45/attachment.htm>
More information about the Beginners
mailing list