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
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.
>
>
>
>
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
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"
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
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
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
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
> |
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
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
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.
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
12 matches
Mail list logo