Closed colin-mcd closed 1 year ago
Nested recursive datatypes like the following cause errors during monomorphization:
data List a = Nil | Cons a (List a); data Matrix a = Mx (List (List a)); let _ = Mx (Cons (Cons () Nil) Nil) in ();
Specifically, the error gets raised by the Map.! in this line: https://github.com/diprism/perpl/blob/73f88eef5d18ff63fda7d9be9f118db33868437e/src/Transform/Monomorphize.hs#L108
Map.!
From early investigation, it looks like there is some lack of substitution going on in arguments of nested polymorphic datatypes.
Nested recursive datatypes like the following cause errors during monomorphization:
Specifically, the error gets raised by the
Map.!
in this line: https://github.com/diprism/perpl/blob/73f88eef5d18ff63fda7d9be9f118db33868437e/src/Transform/Monomorphize.hs#L108From early investigation, it looks like there is some lack of substitution going on in arguments of nested polymorphic datatypes.