Re: Kinds of type synonym arguments

2015-12-21 Thread Edward Kmett
I brought up the subject of allowing newtypes in kind # (or even in any kind that ends in * or # after a chain of ->'s to get more powerful Coercible instances) at ICFP this year and Simon seemed to think it'd be a pretty straightforward modification to the typechecker. I confess, he's likely

Re: Kinds of type synonym arguments

2015-12-21 Thread Reid Barton
On Mon, Dec 21, 2015 at 5:13 AM, Simon Peyton Jones wrote: > newtype T = MkT Int# > > > > Provided T :: # (i.e. unlifted), I don’t think this would be too hard. > That is, you can give a new name (via newtype) to an unlifted type like > Int#, Float#, Double# etc. > > > >

Re: Kinds of type synonym arguments

2015-12-20 Thread Ömer Sinan Ağacan
I have another related question: What about allowing primitive types in newtypes? λ:4> newtype Blah1 = Blah1 Int λ:5> newtype Blah2 = Blah2 Int# :5:23: error: • Expecting a lifted type, but ‘Int#’ is unlifted • In the type ‘Int#’ In the definition of data

Re: Kinds of type synonym arguments

2015-12-16 Thread Ömer Sinan Ağacan
t; So >>> my question is, is there a reason for not doing this, because otherwise I'd >>> like to fix panics etc. and make this change. >>> >>> 2015-12-15 18:08 GMT-05:00 Simon Peyton Jones <simo...@microsoft.com>: >>>> What is "this"

Re: Kinds of type synonym arguments

2015-12-16 Thread Richard Eisenberg
On Dec 16, 2015, at 2:06 PM, Ömer Sinan Ağacan wrote: > > In any case, this is not that big deal. When I read the code I thought this > should be a trivial change but apparently it's not. No, it's not. Your example (`f :: (Int#, b) -> b`) still has an unboxed thing in a

Re: Kinds of type synonym arguments

2015-12-15 Thread Ömer Sinan Ağacan
Hi Richard, Now that we have levity arguments I'm wondering if we should go ahead and implement this. The code is already there - unboxed tuples have levity arguments and then type arguments depend on the levity arguments, so this works: λ> :k (# Int, Int# #) (# Int, Int# #) :: # But

RE: Kinds of type synonym arguments

2015-12-15 Thread Simon Peyton Jones
cis.upenn.edu> | Cc: ghc-devs <ghc-devs@haskell.org> | Subject: Re: Kinds of type synonym arguments | | Hi Richard, | | Now that we have levity arguments I'm wondering if we should go ahead and | implement this. The code is already there - unboxed tuples have levity | arguments and then

Re: Kinds of type synonym arguments

2015-12-15 Thread Ömer Sinan Ağacan
December 2015 23:06 > | To: Richard Eisenberg <e...@cis.upenn.edu> > | Cc: ghc-devs <ghc-devs@haskell.org> > | Subject: Re: Kinds of type synonym arguments > | > | Hi Richard, > | > | Now that we have levity arguments I'm wondering if we should go ahead and > |

Re: Kinds of type synonym arguments

2015-12-15 Thread Dan Doel
hat is "this" that you propose to implement? Is there a wiki page that >> describes the design? >> >> Simon >> >> | -Original Message- >> | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Ömer >> Sinan >> | Agacan

Re: Kinds of type synonym arguments

2015-12-15 Thread Richard Eisenberg
t;>> What is "this" that you propose to implement? Is there a wiki page that >>> describes the design? >>> >>> Simon >>> >>> | -Original Message- >>> | From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Öme

Re: Kinds of type synonym arguments

2015-12-06 Thread Richard Eisenberg
I think this is a consequence of the rule that we never abstract over types of kind #. But I believe this should work with my branch: > type Tuple (a :: TYPE v1) (b :: TYPE v2) = (# a, b #) The user would have to request that the synonym be used over both * and #, but the synonym should work.

Kinds of type synonym arguments

2015-12-06 Thread Ömer Sinan Ağacan
In this program: {-# LANGUAGE MagicHash, UnboxedTuples #-} module Main where import GHC.Prim import GHC.Types type Tuple a b = (# a, b #) main = do let -- x :: Tuple Int# Float# x :: (# Int#, Float# #) x = (# 1#, 0.0# #) return () If I