News for hackers. Stuff that matters.
Re:Implement with types, not your brain (2019) by bweitzman on Tuesday February 25, 2020 @01:13PM (#22415571)
changing a record requires a more specific type than `forall a. a`

the type `forall a . a -> a` does truly have one single (non exception throwing) implementation since there is no information you can glean about your argument other than the fact that it exists.

Once you have more structure, for example in `Person -> Person` or even `forall a . [a] -> [a]`, you have more possible implementations than just the identity function.

There are no comments on this comment yet.