[Haskell-cafe] What's the problem with iota's type signature?

David Leimbach leimy2k at gmail.com
Wed May 27 22:59:44 EDT 2009


On Wed, May 27, 2009 at 7:33 PM, michael rice <nowgate at yahoo.com> wrote:

> Still exploring monads. I don't understand why the type signature for
> double is OK, but not the one for iota.
>
> Michael
>
> =================
>
> --double :: (Int a) => a -> Maybe b
> --double x = Just (x + x)
>
> iota :: (Int a) => a -> [b]
> iota  n = [1..n]


Int is not a class, and you are using it as such?



>
>
> --usage: [3,4,5] >>= iota
> --should produce [1,2,3,1,2,3,4,1,2,3,4,5]
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090527/039d3278/attachment.html


More information about the Haskell-Cafe mailing list