External Publication
Visit Post

Type level programming: Dealing with ambiguous type error

Haskell Community [Unofficial] March 19, 2026
Source

AllowAmbiguousTypes will just push the logical problem elsewhere. A required type argument won’t help because x is highly dynamic.

There seems to be two possible approaches here:

  1. Somehow get the compiler to understand the relationship between m, n and x in the way that it can work here. This is my preferece, but I’m open to the fact that it might not be possible.

  2. Thread through a singleton for x. This is complicated by the fact that it is not trivial to know what x is at any given point. I think I will try implementing an algorithm that passes x in the dumb-list version of my machine.

Discussion in the ATmosphere

Loading comments...