I've been calling this the "golden rule of engineering": to propagate requirements upstream instead of propagating failures downstream
-
-
- Još 2 druga odgovora
Novi razgovor -
-
-
Going to use this in the compilers class! It communicates an important aspect of the design we’re trying to teach.
-
There's a related idea in dependent types: don't compute a Boolean, compute a Decidable, which includes the proof for the yes/no decision, whichever way it goes.
- Još 4 druga odgovora
Novi razgovor -
-
-
Great article! I’ve struggled to communicate these ideas before so thanks for taking the time to articulate them! A particular phrase I’m happy to have words for now: “write functions on the data representation you wish you had, not the data representation you are given”
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
To go one step further, the "right way" to specify a non-free data structure (few data structures are free) is through a pair of parser and unparser... from and to SEXP, not flat character streams, so I can non-trivially interact with it at my Scheme REPL.
-
And the parser/unparser should be specified together as a schema built out of partial isomorphisms, which allow you to only duplicate parser and unparser at the primitive level, and then use partial isomorphism composition operations to build schemas for more complex structures.
- Još 2 druga odgovora
Novi razgovor -
-
-
> All in all, the second approach is superior on all axes. That doesn't seem right. There is a trade-off here: none of our existing List functions will work on NonEmpty.
-
I suspect it's only b/c of heavy use of typeclasses in Haskell that this is bearable in practice. eg. if your code depends on Traversable instead of List, all you need is a new instance, which is much more bearable than rewriting a bunch of list-processing code.
- Još 1 odgovor
Novi razgovor -
-
-
I enjoyed reading this. Thanks.
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.