diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

extern types are not monomorphized #88

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

Example:

data Box a = B a;
extern b : Box Bool;
()

In the main branch, this causes an error because b still has type parameters by the affine-to-linear stage. By reverting a change at AffLin.hs:110 to ignore type parameters, the error goes away, but in a weird way.

% ./perplc -c mono.ppl
data Box_inst0 = B_inst0 Bool;

data Bool = False | True;

extern b : Box;

b

But somehow when an FGG is generated, b has type Box_inst0.