A Modern Architecture for FP
HtDP changed the way I look at programming. But today I&#x27;m a diehard OOP fanatic. I want code that reflects the way I think, not code I have to work to understand.<p>I did not know but am not surprised to find that people write procedural Haskell. Procedural is how we all start out thinking about things. You do A, then B, to reach goal C. It takes time and experience and deliberate practice to improve upon that way of solving problems.<p>Functional moves the code in the direction of math. OOP moves in the direction of the domain. Math is harder to understand than domain logic, you will inevitably hack together an object system on top of your FP in order to implement domain logic.<p>Both styles have properties that are work better for certain domain concepts. What&#x27;s nice about modern programming languages is that they build in primitives so you can use whichever style fits the concept you&#x27;re fleshing out.<p>But trying to do everything functionally is ultimately counter-productive, in my opinion. It&#x27;s the wrong format to declare high-level domain logic in, because high-level domain logic is that which is closest to human thought, not the underlying math.<p>Any FP &#x27;architecture&#x27; will pretty much be object oriented. Math may treat state as ugly cruft, but humans need to group information close to where it&#x27;s needed and in ways that make sense, that means state. Don&#x27;t let the quest for mathematical beauty get in the way of solving your problem.