A series of exercises to get a feel for how generic types and type variables work in Elm.
For each of these, you are given some code that is not compiling. Your task is to get it
compiling. You can change the body of the function but not the signature. No cheating
with Debug.todo
or infinite recursions either 😉
Hint: the more generic your signature, the less you can do in the function body.
@eimfach yes! Those are the sorts of answers these exercises are looking for. In many cases, those are the only implementations that will compile (other than
Debug.todo
, infinite recursions, and similar implementations that work no matter what the signature is).