Writing a compiler in elm?

If I remember correctly, our professor told us that ghc type inference works using a greedy algorithm that performs worse than union-find asymptotically, but better in practise.

I took a look at ghc source code and it seems there is a pure unification algorithm in its Unify.hs module using “Algorithm U”, and an impure unification algorithm in TcUnify.hs.

Maybe a pure unifier in elm-in-elm could perform sufficiently well?