Unlifted data types

Eric Seidel eric at seidel.io
Fri Sep 4 15:29:59 UTC 2015


You mention NFData in the motivation but then say that !Maybe !Int is
not allowed. This leads me to wonder what the semantics of

  foo :: !Maybe Int -> !Maybe Int
  foo x = x

  bar = foo (Just undefined)

are. Based on the FAQ it sounds like foo would *not* force the
undefined, is that correct?


Also, there's a clear connection between these UnliftedTypes and
BangPatterns, but as I understand it the ! is essentially a new type
constructor. So while

  foo1 :: !Int -> !Int
  foo1 x = x

and

  foo2 :: Int -> Int
  foo2 !x = x

have the same runtime behavior, they have different types, so you can't
pass a regular Int to foo1. Is that desirable?

Eric

On Fri, Sep 4, 2015, at 01:03, Edward Z. Yang wrote:
> Hello friends,
> 
> After many discussions and beers at ICFP, I've written up my current
> best understanding of the unlifted data types proposal:
> 
>     https://ghc.haskell.org/trac/ghc/wiki/UnliftedDataTypes
> 
> Many thanks to Richard, Iavor, Ryan, Simon, Duncan, George, Paul,
> Edward Kmett, and any others who I may have forgotten for crystallizing
> this proposal.
> 
> Cheers,
> Edward
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


More information about the ghc-devs mailing list