Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms

2013-04-14 Thread Chris Wong
On Sun, Apr 14, 2013 at 5:10 PM, Christopher Howard christopher.how...@frigidcode.com wrote: type Adjustment a = SaleVariables - a [...] instance Monad Adjustment where (=) = ... return = ... Essentially, you can't partially apply type synonyms. I don't recall the exact reasoning, but

Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms

2013-04-14 Thread Johan Holmquist
It does not really make sense to make a type synonym an instance of some class, because a type synonym is just just what is says -- another name for some type. So making a type synonym for some type T an instance of a class would be the same as making T itself an instance of the class. Typically

Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms

2013-04-14 Thread Erik Hesselink
On Sun, Apr 14, 2013 at 9:28 AM, Chris Wong chrisyco+haskell-c...@gmail.com wrote: On Sun, Apr 14, 2013 at 5:10 PM, Christopher Howard christopher.how...@frigidcode.com wrote: type Adjustment a = SaleVariables - a [...] instance Monad Adjustment where (=) = ... return = ...

Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms

2013-04-14 Thread Daniil Frumin
Maybe you can try curried definition: type Adjustment = (-) SaleVariables I had a similar problem awhile ago. Hth — On Sun, Apr 14, 2013 at 9:11 AM, Christopher Howard christopher.how...@frigidcode.com=mailto:christopher.how...@frigidcode.com; wrote: I asked this question in

Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms

2013-04-14 Thread Daniil Frumin
Oh, I see that I'm late to the party, sorry, wasn't able to push my mail for some time  — On Sun, Apr 14, 2013 at 3:09 PM, Daniil Frumin difru...@gmail.com wrote: Maybe you can try curried definition: type Adjustment = (-) SaleVariables I had a similar problem awhile ago. Hth — On Sun,

Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms

2013-04-14 Thread Steffen Schuldenzucker
The point in not allowing partially applied type synonym instances is that it'd make deciding whether a type is an instance of a class much harder. Cf. here[1] for a similar question with the Category class. -- Steffen [1] Attached message. Couldn't find it on the archives.. On 04/14/2013

[Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms

2013-04-13 Thread Christopher Howard
I asked this question in Haskell-beginners, but I haven't heard anything yet, so I'm forwarding to Cafe. Original Message Subject: [Haskell-beginners] Monad instances and type synonyms Date: Sat, 13 Apr 2013 17:03:57 -0800 From: Christopher Howard