←back to thread

Uncertain<T>

(nshipster.com)
444 points samtheprogram | 2 comments | | HN request time: 0.425s | source
1. black_knight ◴[] No.45056719[source]
This seems closely related to this classic Functional Pearl: https://web.engr.oregonstate.edu/~erwig/papers/PFP_JFP06.pdf

It’s so cool!

I always start my introductory course on Haskell with a demo of the Monty Hall problem with the probability monad and using rationals to get the exact probability of winning using the two strategies as a fraction.

replies(1): >>45061891 #
2. internet_points ◴[] No.45061891[source]
See also the Haskell library monad-bayes https://monad-bayes.netlify.app/tutorials/ https://www.tweag.io/blog/2019-09-20-monad-bayes-1/