Futhark uses unification to drive its type checker, but has different logic to produce error messages!
https://futhark-lang.org/blog/2020-03-15-futhark-0.15.1-released.html
This is a question I've faced on several occasions.
Related Posts
Really cute approach to reporting type errors: when there's a type error, show an example of a runtime error that the type check has prevented!
Data-Driven Techniques for Type Error Diagnosis https://escholarship.org/uc/item/59s4h4pv
I've been using "Expected Int, but got String" for my type error messages, but I've been wondering if I could do better.
"Expected Int here, but this value has type String" or "This expression requires Int, but the value is String".
Do you have a favourite?
Some delightful examples of good compiler error messages in the latest Gleam release: https://gleam.run/news/context-aware-compilation/