diku-dk / futhark

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

Fix #2106. #2107

Closed athas closed 9 months ago

athas commented 9 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.