RE: Known problems with promoted tuples and lists in GHC 7.4.1?

2012-06-06 Thread Simon Peyton-Jones
Kind polymorphism and promoted kinds is *not* an advertised feature of 7.4.1. Much code is there, but it doesn't work when you push it. The HEAD does work. If you are using kind polymorphism or promoted kinds, use HEAD (or a development snapshot). Indeed not_okay compiles fine with HEAD Sim

Re: Kindness of strangers (or strangeness of Kinds)

2012-06-06 Thread AntC
seas.upenn.edu> writes: > > Quoting AntC clear.net.nz>: > > > {-# OPTIONS_GHC -XDataKinds -XPolyKinds -XKindSignatures#-} > > > > data MyNat = Z | S MyNat > > > > class NatToIntN (n :: MyNat) > > where natToIntN :: (n :: MyNat) -> Int > > instance NatToIntN Z > >

Re: Kindness of strangers (or strangeness of Kinds)

2012-06-06 Thread wagnerdm
Quoting AntC : {-# OPTIONS_GHC -XDataKinds -XPolyKinds -XKindSignatures#-} data MyNat = Z | S Nat class NatToIntN (n :: MyNat) where natToIntN :: (n :: MyNat) -> Int instance NatToIntN Z where natToIntN _ = 0 instance (NatToIntN n) => NatToIntN (S n)

Kindness of strangers (or strangeness of Kinds)

2012-06-06 Thread AntC
I'm confused about something with promoted Kinds (using an example with Kind- promoted Nats). This is in GHC 7.4.1. (Apologies if this is a known bug/limitation/already explained somewhere -- I know 7.4.1 is relatively experimental. I have searched the bug tracs and discussions I could find.) S

Re: Known problems with promoted tuples and lists in GHC 7.4.1?

2012-06-06 Thread David Menendez
No, I'm just running 7.4.1. Here's a very stripped-down example of what I'm seeing: {-# LANGUAGE PolyKinds, DataKinds #-} data Pair a b = P a b data Nat = Z | S Nat data Phantom i = Phantom okay :: Phantom ('P Int Int) okay = Phantom -- not_okay :: Phantom '(Int, Int) -- not_okay = Phantom U

Re: Known problems with promoted tuples and lists in GHC 7.4.1?

2012-06-06 Thread José Pedro Magalhães
Hi David, Are you using HEAD? If so, and you run into problems, please report them (either here or as bugs in trac). Thanks, Pedro On Wed, Jun 6, 2012 at 9:37 PM, David Menendez wrote: > Are there any known issues involving type-level pairs and lists? I've > hit a few baffling type errors tha

Known problems with promoted tuples and lists in GHC 7.4.1?

2012-06-06 Thread David Menendez
Are there any known issues involving type-level pairs and lists? I've hit a few baffling type errors that went away when I refactored my code to use locally-defined pairs and lists instead of those provided by the prelude. More worryingly, I had one function that would stop passing the type checke