... | ... | @@ -91,6 +91,29 @@ TODO |
|
|
|
|
|
- The constructors of the `Info` type now have one field less (TODO more details)
|
|
|
|
|
|
- The `Strict` datatype has been overhauled. The functional equivalent of `Strict` in `template-haskell-2.11.0.0` is `Bang`:
|
|
|
|
|
|
```
|
|
|
dataBang=BangSourceUnpackednessSourceStrictnessdataSourceUnpackedness=NoSourceUnpackedness-- ^ @C a@|SourceNoUnpack-- ^ @C {-# NOUNPACK #-} a@|SourceUnpack-- ^ @C {-# UNPACK #-} a@dataSourceStrictness=NoSourceStrictness-- ^ @C a@|SourceLazy-- ^ @C ~a@|SourceStrict-- ^ @C !a@typeBangType=(Bang,Type)typeVarBangType=(Name,Bang,Type)
|
|
|
```
|
|
|
|
|
|
> >
|
|
|
> > Note that the notions of unpackedness and strictness, which were previously combined in `Strict`, have now been decoupled. Also note the emphasis on *source*, as `Bang` represents what the user writes in source code. A field's *source* strictness may be quite different from what GHC actually *decides* to use as a field's strictness.
|
|
|
|
|
|
> >
|
|
|
> > For example, if `-XStrict` is enabled, GHC will decided that any field not marked with a laziness annotation (`~`) will become strict. So if you compile the following datatype with `-XStrict` enabled:
|
|
|
|
|
|
```
|
|
|
dataExample a =Example a
|
|
|
```
|
|
|
|
|
|
> >
|
|
|
> > GHC will decide that `Example`'s field is strict. However, if you reify `Example`, its `Bang` value will be `Bang NoSourceUnpackedness NoSourceStrictness` because the user did not put an explicit strictness annotation (`!`) in the source code. To figure out what GHC decided, use the `reifyConStrictness` function:
|
|
|
|
|
|
```
|
|
|
reifyConStrictness::Name->Q[DecidedStrictness]dataDecidedStrictness=DecidedLazy|DecidedStrict|DecidedUnpack
|
|
|
```
|
|
|
|
|
|
---
|
|
|
|
|
|
## Tool changes
|
... | ... | |