haskell-users@haskell.org
| Subject: Re: ConstraintKinds and default associated empty constraints
|
| On Mon, Jan 9, 2012 at 4:53 PM, Simon Peyton-Jones
| wrote:
| > Three things about this ConstraintKinds thread:
| >
| > First, about
| > class Functor f where
| > type C f a ::
or and Exofunctor...)
>
> Again, I have no problem at all with the Empty class, it's the same
> solution I've used. It's even kind polymorphic if you turn that
> extension on. The syntax isn't superficially as nice, but it's nice
> enough, does the job, and I d
ce
enough, does the job, and I don't see how you could do better short of
adding type-level lambdas (so you can write type C f = \_ -> ()).
[1] http://hackage.haskell.org/trac/ghc/ticket/2893
>
> | -Original Message-
> | From: glasgow-haskell-users-boun...@haskell.org [mailto:g
On Sun, Jan 8, 2012 at 8:32 AM, Bas van Dijk wrote:
> On 23 December 2011 17:44, Simon Peyton-Jones
> 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 s
Of Andres Löh
| 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 :: Con
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
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 re
On Mon, Jan 9, 2012 at 12:30 AM, Antoine Latter wrote:
> On Sun, Jan 8, 2012 at 11:21 PM, wren ng thornton 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 e
On Sun, Jan 8, 2012 at 11:21 PM, wren ng thornton 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 :: * -> Constraint
On 1/8/12 8:32 AM, Bas van Dijk wrote:
On 23 December 2011 17:44, Simon Peyton-Jones 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
On 23 December 2011 17:44, Simon Peyton-Jones 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 * ->
> Constraint
So am I
011 16:41
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
mailto:simo...@microsoft.com>> wrote:
Right now it seems it is either * or Constrai
On Fri, Dec 23, 2011 at 10:17 AM, Simon Peyton-Jones
wrote:
> 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, that agrees
figure out which is intended from context.
S
From: Edward Kmett [mailto:ekm...@gmail.com]
Sent: 23 December 2011 15:05
To: Simon Peyton-Jones
Cc: Bas van Dijk; glasgow-haskell-users@haskell.org
Subject: Re: ConstraintKinds and default associated empty constraints
Fair enough.
So if I understand y
to: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 empty constraints
>
> On Wed, Dec 21, 2011 at 6:45 PM, Bas van
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
On Wed, Dec 21, 2011 at 6:45 PM, Bas van Dijk 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 wonder if the trick wi
On Thu, Dec 22, 2011 at 12:45 AM, Bas van Dijk 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 wonder if the trick wi
On 22 December 2011 09:31, Simon Peyton-Jones 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 `* ->
Constraint` but () has
On 22 December 2011 01:58, wrote:
> Quoting Bas van Dijk :
>
>> 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
alf Of Bas van Dijk
| Sent: 21 December 2011 23:46
| To: glasgow-haskell-users@haskell.org
| Subject: ConstraintKinds and default associated empty constraints
|
| 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
Quoting Bas van Dijk :
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 a;
instance Empty a,
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 a;
instance Empty a, is the recommended way to
23 matches
Mail list logo