[Haskell-beginners] Enum for natural numbers
kane96 at gmx.de
kane96 at gmx.de
Mon Dec 21 12:27:03 EST 2009
-------- Original-Nachricht --------
> Datum: Mon, 21 Dec 2009 15:06:38 +0100
> Von: Daniel Fischer <daniel.is.fischer at web.de>
> An: beginners at haskell.org
> CC: kane96 at gmx.de
> Betreff: Re: [Haskell-beginners] Enum for natural numbers
> Am Montag 21 Dezember 2009 15:02:16 schrieb kane96 at gmx.de:
> > In another task I should create an infinite list: allNats :: [Nat]
> > I would have done it in a recursion but there issn't a parameter to call
> > allNats with
>
> Prelude> :t iterate
> iterate :: (a -> a) -> a -> [a]
this works:
allNats = (iterate (1+) 1)
but it doesn't match my declaration:
allNats :: [Nat]
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
More information about the Beginners
mailing list