diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

Parameterized type used non-recursively #68

Closed davidweichiang closed 1 year ago

davidweichiang commented 2 years ago

When a datatype has a parameter

data box a = Box a;

and it is applied to itself, like box (box Unit), it is currently treated as recursive even though it's not.

define copy_mono = \x: box (box Unit). (x, x); -- causes an error
define copy_poly = \x. (x, x); -- ok
extern e: box (box Unit); -- causes an error
let x = (Box (Box ())) in (copy_mono x, copy_poly x)