Top all-time · #10787
ren.zone
Personal blog · ren.zone/articlesprogramming
ren.zone is a personal blog at ren.zone about programming. Since 2015, 7 different Hacker News readers have linked it 9 times, most often “Safe-money: Money in the type system where it belongs (2017)”. No feed was found, so read it on the site itself.
Too few sampled comments (7) to say how often HN recommends it.?
Why HN links it
HN readers link ren.zone for Haskell articles, especially the safe-money post on using phantom types so that amounts in different currencies cannot be mixed, and opaleye-sot on NULL, DEFAULT and Maybe in database code.
Summarised by Claude from a sample of 7 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- Safe-money: Money in the type system where it belongs (2017)5 people · 6 mentions · first linked 2018-01-08
- Opaleye’s sugar on top: SQL in the type system2 people · 2 mentions · first linked 2015-11-07
What Hacker News says?
Phantom types can be useful when modelling currency: the "implementation" stays the same but you want to avoid summing two different currencies by mistake. https://ren.zone/articles/safe-money
Comment linking /articles/safe-money
on “Haskell Mini-Patterns Handbook”Submitted Safe-money: Money in the type system where it belongs (2017) as a story · 58 points
HN discussionThen you may find the discussion of NULL vs DEFAULT and Maybe's in https://ren.zone/articles/opaleye-sot interesting.
Comment linking /articles/opaleye-sot
on “Interview with Simon Peyton-Jones”Submitted Opaleye’s sugar on top: SQL in the type system as a story · 58 points
HN discussionSee https://blog.jle.im/entry/practical-dependent-types-in-haske... where you get this function definition: https://github.com/mstksg/inCode/blob/master/code-samples/de... I liked this article: https://ren.zone/articles/safe-money where they get e.g. an ExchangeRate "USD" "JPY" type from input that has a different type from ExchangeRate "EUR" "JPY" (and thus can't be used to convert euros, only US dollars).
Comment linking /articles/safe-money
on “Typesafe Neural Networks in Haskell with Dependent Types”My favourite money library is safe- money in Haskell. It basically catches 99% of the most common money bugs at compile time https://ren.zone/articles/safe-money
Comment linking /articles/safe-money
on “Dinero.js – JavaScript library for working with monetary values”Handling currency in JavaScript just sounds like a bad idea. It's better to be using a language with a type system that has your back on this kind of thing, and preferably to deal with monetary values as rational numbers. There's a good article on this subject here: https://ren.zone/articles/safe-money
Comment linking /articles/safe-money
on “How to Handle Monetary Values in JavaScript”I suppose it depends tremendously on the application you are developing but combining Haskell with things like Haxl[1] and opaleye-sot[2] can help simplify the database aspect of things tremendously. Once you've abstracted away the persistence and querying details, I think you get to the best part of FP which is modeling the actual behaviour/flow of data and types. In a typical app lifecycle Haskell starts shining m…
Comment linking /articles/opaleye-sot
on “Anatomy of a Haskell-based Application”This is an interesting take on handling money. By far my favorite library for abstracting over monetary operations is safe-money. The author does a good job at building up the abstractions from first principles in this post: https://ren.zone/articles/safe-money
Comment linking /articles/safe-money
on “Dinero.js an immutable library for working with monetary values in JavaScript”