Sean Leather | 19 Nov 15:18 2012
Picon

Promoted types accepted without language extensions

We discovered that GHC and GHCi (7.4.1) accept promoted types without specifying language extensions (and even when specifying -XHaskell98).

For example, promoted lists are accepted:

Prelude> type T = [Int,Char]
Prelude> :i T
type T = (:) * Int ((:) * Char ([] *))
  -- Defined at <interactive>:2:6

Also, promoted datatypes:

> data N = Z
> type T = 'Z

I'm guessing you can't use these types anywhere (since they are not kind *), so they won't be very useful, but it seems like this should be disallowed.

Regards,
Sean
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
José Pedro Magalhães | 19 Nov 15:24 2012
Picon

Re: Promoted types accepted without language extensions

Hi Sean,

On Mon, Nov 19, 2012 at 2:18 PM, Sean Leather <leather <at> cs.uu.nl> wrote:
We discovered that GHC and GHCi (7.4.1) accept promoted types without specifying language extensions (and even when specifying -XHaskell98).

For example, promoted lists are accepted:

Prelude> type T = [Int,Char]
Prelude> :i T
type T = (:) * Int ((:) * Char ([] *))
  -- Defined at <interactive>:2:6

This is rejected in 7.6.1:

<interactive>:2:10:
    Illegal type: '[Int, Char] Perhaps you intended to use -XDataKinds
 

Also, promoted datatypes:

> data N = Z
> type T = 'Z

This isn't rejected, but I guess it should, indeed.


Thanks,
Pedro
 

I'm guessing you can't use these types anywhere (since they are not kind *), so they won't be very useful, but it seems like this should be disallowed.

Regards,
Sean

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Gmane