Curried use of strict ?Just causes segmentation fault
For example, this causes a segmentation fault on the current x64 nightly:
import StdEnv
f :: (Int -> ?Int)
f = ?Just o ((+) 5)
Start = f 1
Whereas this works fine with a custom ADT:
:: M a = J !a
g :: (Int -> M Int)
g = J o ((+) 5)
Start = g 1
Also f = (\x -> ?Just x) o ((+) 5)
works fine.
I think ?Just
should be defined as a .record
in _system.abc, with the corresponding lazy entry for currying, as is done with strict lists and constructors.
Finally, I'm not sure whether it is related or not, but f = ?Just
results in a lazy ?^Just
being created:
f :: (Int -> ?Int)
f = ?Just
Start = f 1