Unlifted data types

Dan Doel dan.doel at gmail.com
Fri Sep 4 21:56:03 UTC 2015


If x :: t, and t :: Unlifted, then

    let x = e in e'

has a value that depends on evaluating e regardless of its use
in e' (or other things in the let, if they exist). It would be like writing

    let !x = e in e'

today.

-- Dan

On Fri, Sep 4, 2015 at 5:41 PM, Roman Cheplyaka <roma at ro-che.info> wrote:
> On 05/09/15 00:23, Edward Z. Yang wrote:
>> I would certainly agree that in terms of the data that is representable,
>> there is not much difference; but there is a lot of difference for the
>> client between Force and a strict field. If I write:
>>
>>     let x = undefined
>>         y = Strict x
>>     in True
>>
>> No error occurs with:
>>
>>     data Strict = Strict !a
>>
>> But an error occurs with:
>>
>>     data Strict = Strict (Force a)
>
> At what point does the error occur here? When evaluating True?
>
> What about the following two expressions?
>
>     const False
>       (let x = undefined
>            y = Strict x
>       in True)
>
>     let x = undefined
>         y = const False (Strict x)
>     in True
>
> Roman
>
>
> _______________________________________________
> 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