Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's just a lot of words for saying that you use [fill in the blank with your language of choice's words, like classes or interfaces] to wrap your classes with such that the wrappers provide methods that let you do a variety of things:

  - associate immutable contextual stuff with your data
    (think configuration, in C you'd add a context object
     pointer argument to all your functions, but in Haskell
     you'd just wrap your objects in monads)
  - associate "mutable" contextual stuff with your data
    (think state, in C you'd add a context...)
  - abstract out I/O so you can write fully deterministic
    code that's easy to test
  - etc. (e.g., tracing, logging, transactions,
    backtracking, and whatever else you can imagine)
along with standard methods that allow you to chain "statements" into a single expression while still looking like it's "statements".


You don't need category theory to understand how type-structure-preserving wrappers work in software development, and people invented them without knowing about category theory.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: