Hacker News new | ask | show | jobs
by jolmg 2321 days ago
Yesod[1]. In part, that's because Haskell in general is really easy to read. The type-system provides a lot of information about what's going on or what can go on at any given point in the code.

I've read both parts of Rails and Yesod. The problem with Rails is that a lot of the code is dynamically generated. The lack of static type information means I have to investigate in run-time with binding.pry to see what kind of data is flowing through a function at any given moment. Rails also employs a lot of magic that results in weird, inconsistent corner cases.

My methodology for Rails is to find a method involved in what I'm investigating and insert binding.pry statements where-ever I'd be curious about what kind of data is flowing or effects are happening. Then do the action that I'm investigating, check the context where I put the binding.pry statement, and insert more such statements. Rinse and repeat.

My methodology for Yesod is to go to the documentation pages like this one[2], and click around the hyperlinks to functions and types. That's normally enough to know how the data is flowing and being affected. If I need to look further, I'd hit the source link and read it. The type information always provides enough info that I don't need to try to investigate in run-time.

[1] https://www.yesodweb.com/

[2] https://www.stackage.org/haddock/lts-14.25/yesod-core-1.6.17...