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

2009-05-28 Thread wren ng thornton
michael rice wrote: Yeah, I went back and tried double again, though I'd swear I got the dang thing to compile (and run) w/o errors. I guess I meant Num. So Num is a class and Int and Integer are types? What are the other classes? Docs? Unification, for me, is pattern matching ala Prolog.

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

2009-05-28 Thread michael rice
wrote: From: wren ng thornton w...@freegeek.org Subject: Re: [Haskell-cafe] What's the problem with iota's type signature? To: Haskell-cafe haskell-cafe@haskell.org Date: Thursday, May 28, 2009, 11:14 PM michael rice wrote: Yeah, I went back and tried double again, though I'd swear I got the dang

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

2009-05-27 Thread michael rice
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] --usage: [3,4,5] = iota --should produce

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

2009-05-27 Thread Lionel Barret de Nazaris
On 28/05/2009 04:33, michael rice 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] --usage:

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

2009-05-27 Thread David Leimbach
On Wed, May 27, 2009 at 7:33 PM, michael rice nowg...@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

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

2009-05-27 Thread Lee Duhem
On Thu, May 28, 2009 at 10:33 AM, michael rice nowg...@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) Prelude let double x

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

2009-05-27 Thread wren ng thornton
michael rice wrote: Still exploring monads. I don't understand why the type signature for double is OK, It isn't. The |a| and |b| variables must unify: Prelude :t \x - Just (x+x) \x - Just (x+x) :: (Num a) = a - Maybe a Prelude :t (\x - Just (x+x)) :: Num a = a - Maybe b

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

2009-05-27 Thread michael rice
in Haskell? Docs? I've been digging into this stuff for months and it's still tripping me up. Very frustrating. Thanks. Michael --- On Thu, 5/28/09, wren ng thornton w...@freegeek.org wrote: From: wren ng thornton w...@freegeek.org Subject: Re: [Haskell-cafe] What's the problem with iota's type