diku-dk / futhark

:boom::computer::boom: A data-parallel functional programming language
http://futhark-lang.org
ISC License
2.36k stars 165 forks source link

Fix #2106. #2107

Closed athas closed 5 months ago

athas commented 5 months ago

This looks a lot more complicated than it ought to. The real bug was a mishandling of local polymorphic functions in monomorphisation. I reasoned that there is no reason monomorphisation should ever encounter those - we should lambda lift those before we monomorphise. However, that created the need for a bunch of other modifications, including a new (very small) pass (ApplyTypeAbbrs) that runs just after defunctorisation.

IT is overall a conceptual simplification, but the code changes look quite large for such a small bug.