... | ... | @@ -165,3 +165,23 @@ Currently the Boot Packages that are not installed are `haskelline`, `mtl`, and |
|
|
|
|
|
|
|
|
The `haskell98`, `old-time` and `random` packages are mostly only needed for Haskell 98 support, although `dph` currently uses `random` too.
|
|
|
|
|
|
|
|
|
Note that `ghc-prim` and `integer-impl` are below the dependency chain from Exception (in `base`), which means they must not raise generate code to raise an exception (it's not enough that this code will never run). One particularly subtle case of GHC exception-raising code is in the case of (complete!) pattern matches. Consider the unboxed form of Integers, which has the constructor S\# or J\#.
|
|
|
|
|
|
```wiki
|
|
|
f (S# _) (S# _) = ...
|
|
|
f x (S# _) = ...
|
|
|
f (S# _) y = ...
|
|
|
f (J# _ _) (J# _ _) = ...
|
|
|
```
|
|
|
|
|
|
|
|
|
GHC will incorrectly generate core that pattern matches against the second argument twice, the second match being a partial one with (dead) exception raising code. When compiled with optimizations, the dead code is eliminated. However, this breaks with -O0, so the fix was to explicitly spell out the constructor in the second and third line:
|
|
|
|
|
|
```wiki
|
|
|
f (S# _) (S# _) = ...
|
|
|
f (J# _ _) (S# _) = ...
|
|
|
f (S# _) (J# _ _) = ...
|
|
|
f (J# _ _) (J# _ _) = ...
|
|
|
``` |
|
|
\ No newline at end of file |