Re: [Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-30 Thread Ryan Ingram
On Wed, Sep 29, 2010 at 9:13 PM, Alexander Solla wrote: >  On 09/29/2010 02:15 PM, DavidA wrote: >>> >>> instance Monad (\v ->  Vect k (Monomial v)) >>> > >> >> Yes, that is exactly what I am trying to say. And since I'm not allowed to >> say >> it like that, I was trying to say it using a type sy

Re: [Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-29 Thread Stefan Holdermans
David, Ryan Ingram wrote: >>> Haskell doesn't have true type functions; what you are really saying >>> is >>> >>> instance Monad (\v -> Vect k (Monomial v)) Daniel Fischer wrote: > I think there was a theoretical reason why that isn't allowed (making type > inference undecidable? I don't reme

Re: [Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-29 Thread Alexander Solla
On 09/29/2010 09:13 PM, Alexander Solla wrote: On 09/29/2010 02:15 PM, DavidA wrote: instance Monad (\v -> Vect k (Monomial v)) > Yes, that is exactly what I am trying to say. And since I'm not allowed to say it like that, I was trying to say it using a type synonym parameterised over v i

Re: [Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-29 Thread Alexander Solla
On 09/29/2010 02:15 PM, DavidA wrote: instance Monad (\v -> Vect k (Monomial v)) > Yes, that is exactly what I am trying to say. And since I'm not allowed to say it like that, I was trying to say it using a type synonym parameterised over v instead. Why not: instance Monad ((->) Vect k (M

Re: [Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-29 Thread Gábor Lehel
On Wed, Sep 29, 2010 at 11:15 PM, DavidA wrote: > Ryan Ingram gmail.com> writes: > >> Haskell doesn't have true type functions; what you are really saying is >> >> instance Monad (\v -> Vect k (Monomial v)) >> > > Yes, that is exactly what I am trying to say. And since I'm not allowed to say > it

Re: [Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-29 Thread Ryan Ingram
It's hard. Here's a simple example: type Foo f = f Int class C (f :: (* -> *) -> *) where thingy :: f [] -> f IO -- Should this ever typecheck? I would say no; there's no way to unify f [] with [Int]. callThingy :: [Int] -> IO Int callThingy = thingy -- but what if you say this? instance C

Re: [Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-29 Thread Daniel Fischer
On Wednesday 29 September 2010 23:15:14, DavidA wrote: > Ryan Ingram gmail.com> writes: > > Haskell doesn't have true type functions; what you are really saying > > is > > > > instance Monad (\v -> Vect k (Monomial v)) > > Yes, that is exactly what I am trying to say. And since I'm not allowed > t

[Haskell-cafe] Re: Monad instance for partially applied type constructor?

2010-09-29 Thread DavidA
Ryan Ingram gmail.com> writes: > Haskell doesn't have true type functions; what you are really saying is > > instance Monad (\v -> Vect k (Monomial v)) > Yes, that is exactly what I am trying to say. And since I'm not allowed to say it like that, I was trying to say it using a type synonym par