External Publication
Visit Post

Type level programming: Dealing with ambiguous type error

Haskell Community [Unofficial] March 19, 2026
Source

The simple solution is to make x a required type argument. You can also try your luck at enabling AllowAmbiguousTypes, but maybe you’ll get an ambiguity error when you try to use eval anyway.

I do think Plus n (given one argument) should be injective. Perhaps you can find some other way to define it which the compiler can understand. For example a typeclass with functional dependencies.

Discussion in the ATmosphere

Loading comments...