[Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms
sschuldenzucker at uni-bonn.de
Sun Apr 14 13:21:49 CEST 2013
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
Cf. here for a similar question with the Category class.
 Attached message. Couldn't find it on the archives..
On 04/14/2013 07:10 AM, Christopher Howard wrote:
> 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<christopher.howard at frigidcode.com>
> Reply-To: The Haskell-Beginners Mailing List - Discussion of primarily
> beginner-level topics related to Haskell<beginners at haskell.org>
> To: Haskell Beginners<beginners at haskell.org>
> I am playing around with some trivial code (for learning purposes) I
> wanted to take
> -- SaleVariables a concrete type defined early
> -- `Adjustment' represents adjustment in a price calculation
> -- Allows functions of type (a -> Adjustment a) to be composed
> -- with an appropriate composition function
> type Adjustment a = SaleVariables -> a
> And put it into
> instance Monad Adjustment where
> (>>=) = ...
> return = ...
> If I try this, I get
> Type synonym `Adjustment' should have 1 argument, but has been given none
> In the instance declaration for `Monad Adjustment'
> But if I give an argument, then it doesn't compile either (it becomes a
> "*" kind). And I didn't want to make the type with a regular "data"
> declaration either, because then I have to give it a constructor, which
> doesn't fit with what I want the type to do.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An embedded message was scrubbed...
From: Steffen Schuldenzucker <sschuldenzucker at uni-bonn.de>
Subject: Re: [Haskell-cafe] Arrow instance of function type [a] -> [b]
Date: Wed, 06 Jul 2011 15:43:35 +0200
More information about the Haskell-Cafe