News for hackers. Stuff that matters.
Re:Implement with Types, Not Your Brain by schwurb on Tuesday June 25, 2019 @07:50PM (#20280492)
Note that Haskell makes very few assumptions about the users; the quality and complexity of Haskell code varies greatly. The author of this block is dealing with an abstract topic, resulting in somewhat arcane looking code (I am sure that after some refactoring it would read nicer). It is however very possible to write really easy to understand Haskell code by ignoring its more fancy features and sticking to the most used abstractions: Monads, Applicatives and Functors. They alone are enough to write great code, no category theory, effect library, type magic or whatever is needed. Simple, real-world Haskell exists, it is just not often blogged about.
Re:Implement with Types, Not Your Brain by munchbunny on Tuesday June 25, 2019 @07:59PM (#20280555)
Fair enough, I just disagree with the premise that heavily relying on the type system actually lets you think less hard about how to implement your code. In my experience, defining the types you'll use at module boundaries is the actual hardest part. The stuff in the middle is usually straightforward until you realize you need sub-modules, at which point you're defining module boundary types again.
Re:Implement with Types, Not Your Brain by seanmcdirmid on Tuesday June 25, 2019 @11:06PM (#20281533)
A good type is like a heads up display about where you are in your implementation. Haskell types are often far away from being that, however.