-users@haskell.org
| Subject: Re: ConstraintKinds and default associated empty constraints
|
| Hi.
|
| The definitions are accepted by GHC:
|
| class Functor f where
| type FC f a :: Constraint
| type FC f a = ()
|
| fmap :: (FC f a, FC f b) = (a - b) - f a - f b
On Sun, Jan 8, 2012 at 8:32 AM, Bas van Dijk v.dijk@gmail.com wrote:
On 23 December 2011 17:44, Simon Peyton-Jones simo...@microsoft.com
wrote:
My attempt at forming a new understanding was driven by your example.
class Functor f where
type C f :: * - Constraint
type C f =
| Sent: 09 January 2012 07:28
| To: Antoine Latter
| Cc: glasgow-haskell-users@haskell.org
| Subject: Re: ConstraintKinds and default associated empty constraints
|
| Hi.
|
| The definitions are accepted by GHC:
|
| class Functor f where
| type FC f a :: Constraint
07:28
| To: Antoine Latter
| Cc: glasgow-haskell-users@haskell.org
| Subject: Re: ConstraintKinds and default associated empty constraints
|
| Hi.
|
| The definitions are accepted by GHC:
|
| class Functor f where
| type FC f a :: Constraint
| type FC f
| Subject: Re: ConstraintKinds and default associated empty constraints
|
| On Mon, Jan 9, 2012 at 4:53 PM, Simon Peyton-Jones
| simo...@microsoft.com wrote:
| Three things about this ConstraintKinds thread:
|
| First, about
| class Functor f where
| type C f a :: Constraint
| type C f
On 23 December 2011 17:44, Simon Peyton-Jones simo...@microsoft.com wrote:
My attempt at forming a new understanding was driven by your example.
class Functor f where
type C f :: * - Constraint
type C f = ()
sorry -- that was simply type incorrect. () does not have kind * -
On 1/8/12 8:32 AM, Bas van Dijk wrote:
On 23 December 2011 17:44, Simon Peyton-Jonessimo...@microsoft.com wrote:
My attempt at forming a new understanding was driven by your example.
class Functor f where
type C f :: * - Constraint
type C f = ()
sorry -- that was simply type
On Sun, Jan 8, 2012 at 11:21 PM, wren ng thornton w...@freegeek.org wrote:
Couldn't the following work?
class Functor f where
type C f :: * - Constraint
type C f _ = ()
I get a parse error from that.
The equivalent:
class Functor f where
type FC f :: * -
On Mon, Jan 9, 2012 at 12:30 AM, Antoine Latter aslat...@gmail.com wrote:
On Sun, Jan 8, 2012 at 11:21 PM, wren ng thornton w...@freegeek.org wrote:
Couldn't the following work?
class Functor f where
type C f :: * - Constraint
type C f _ = ()
I get a parse error from
That would be nice. It would also be nice to be able to use _ in type
signatures as in:
const :: a - _ - a
const x _ = x
During type checking each _ could be replaced by a new unique type
variable. Visa versa should also be possible: during type inferencing each
unique type variable could be
Hi.
The definitions are accepted by GHC:
class Functor f where
type FC f a :: Constraint
type FC f a = ()
fmap :: (FC f a, FC f b) = (a - b) - f a - f b
instance Functor [] where
fmap = map
Yes. This is what I would have expected to work.
But I don't like
it’s a bug. I’m fixing it.
Simon
From: glasgow-haskell-users-boun...@haskell.org
[mailto:glasgow-haskell-users-boun...@haskell.org] On Behalf Of Edward Kmett
Sent: 22 December 2011 17:03
To: Bas van Dijk
Cc: glasgow-haskell-users@haskell.org
Subject: Re: ConstraintKinds and default associated
...@haskell.org] On Behalf Of Edward Kmett
Sent: 22 December 2011 17:03
To: Bas van Dijk
Cc: glasgow-haskell-users@haskell.org
Subject: Re: ConstraintKinds and default associated empty constraints
On Wed, Dec 21, 2011 at 6:45 PM, Bas van Dijk v.dijk@gmail.com wrote:
I'm playing a bit
On Fri, Dec 23, 2011 at 10:17 AM, Simon Peyton-Jones
simo...@microsoft.comwrote:
Right now it seems it is either * or Constraint depending on context. ***
*
** **
Correct. Tuple bracket are used for both types and Constraints, and we
have to decide which from context.
**
Whew,
To: Simon Peyton-Jones
Cc: Bas van Dijk; glasgow-haskell-users@haskell.org
Subject: Re: ConstraintKinds and default associated empty constraints
On Fri, Dec 23, 2011 at 10:17 AM, Simon Peyton-Jones
simo...@microsoft.commailto:simo...@microsoft.com wrote:
Right now it seems it is either
On 22 December 2011 01:58, wagne...@seas.upenn.edu wrote:
Quoting Bas van Dijk v.dijk@gmail.com:
I'm playing a bit with the new ConstraintKinds feature in GHC
7.4.1-rc1. I'm trying to give the Functor class an associated
constraint so that we can make Set an instance of Functor. The
On 22 December 2011 09:31, Simon Peyton-Jones simo...@microsoft.com wrote:
What about
class Functor f where
type C f :: * - Constraint
type C f = ()
After all, just as (Ord a, Show a) is a contraint, so is ().
But there's a kind mis-match there. `C f` should have kind `* -
On Thu, Dec 22, 2011 at 12:45 AM, Bas van Dijk v.dijk@gmail.com wrote:
I'm playing a bit with the new ConstraintKinds feature in GHC
7.4.1-rc1. I'm trying to give the Functor class an associated
constraint so that we can make Set an instance of Functor. The
following code works but I
On Wed, Dec 21, 2011 at 6:45 PM, Bas van Dijk v.dijk@gmail.com wrote:
I'm playing a bit with the new ConstraintKinds feature in GHC
7.4.1-rc1. I'm trying to give the Functor class an associated
constraint so that we can make Set an instance of Functor. The
following code works but I
Quoting Bas van Dijk v.dijk@gmail.com:
I'm playing a bit with the new ConstraintKinds feature in GHC
7.4.1-rc1. I'm trying to give the Functor class an associated
constraint so that we can make Set an instance of Functor. The
following code works but I wonder if the trick with: class Empty
20 matches
Mail list logo