diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

Affine lambda at top level #63

Closed davidweichiang closed 1 year ago

davidweichiang commented 2 years ago

If I run

\x. factor 0.5 in ()

the sum-product is

[0.5, 1.0]

and I'm not sure that's really the right answer.

davidweichiang commented 2 years ago

The top-level type, btw, is <Unit->Unit, Unit>. The weight 0.5 is for the case where the lambda gets used; 1 is for the case where the lambda doesn't get used.

I tend to think that we should just require that the top-level type be positive (robust).

colin-mcd commented 1 year ago

Yeah that sounds reasonable, I think at some point I required it to be robust but must've (perhaps accidentally) removed that restriction sometime.