3 ms·
You might like the paper “Ghosts of Departed Proofs” which shows a great technique for dealing with preconditions in Haskell.
by mbrock 7y ago
You might like the paper “Ghosts of Departed Proofs” which shows a great technique for dealing with preconditions in Haskell.
- ferzul 7y agoI'll surely read it, but based on the abstract, it's a design pattern for library writers, not a sanity pattern for library users. it won't let me know how or if the function you wrote will throw an exception, or what kind of exception it will throw, unless it's documented in the type. but my objection is that many times, the possibly of failure is only present in my generic, language/api agnostic knowledge that a file might not be readable or a ship might drop an anchor on a cable. having thought about it, I then have to read the source code to understand what exception might get thrown, so I can prevent my program from crashing. (i would prefer it to continue as best as it can in the case that some api is unavailable, which is obviously a usecase dependent decision)
- mbrock 7y agoMy general approach to programming is that every language at the moment is bad in serious, fatal ways, and that we are all just experimenting and practicing so that 50 years from now we might have a decent approach. Haskell is horrible in some ways, excellent in others, and this paper seems to offer a promising technique.