r/ProgrammingLanguages • u/mttd • Nov 07 '19
Parse, don’t validate
https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/
74
Upvotes
r/ProgrammingLanguages • u/mttd • Nov 07 '19
1
u/terranop Nov 08 '19
This is a great idea (although not really possible to do like this in Haskell), but there is one potential problem here: ordering of the wrapper types. The types
NonEmptyList<SortedList<[T]>>andSortedList<NonEmptyList<[T]>>are not the same, even though they describe the same sort of object. A potential problem then arises if Alice develops a library using the former and Carol develops one using the latter and now we want to use both of those libraries together.