Currently Reading - http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html
I've worked through the first 6 examples where you create bind
and unit
functions
for each "would-be" monad. But I'm having trouble understanding the "Random Numbers"
example. (Just after excercise 6)
Slightly confused by how the types of the outputs of f, g are going to agree - Both output b and accept a.
My main problem is with the type signature of bind
for the functions.
I would expect bind f
to have type:
(StdGen -> (b, StdGen)) -> (StdGen -> (b, StdGen))
But that's not the case
Notes for Task 9:
![0583b5cd-7d08-478d-9cb4-720541ad2083](https://user-images.githubusercontent.com/46719614/182655658-355ce261-d174-4938-b8e5-b1e0fa4337ac.jpg)
![0af425d2-b244-40d9-9343-d23fad19d0f0](https://user-images.githubusercontent.com/46719614/182655687-507f864c-e63f-412c-a4d4-d6628bfc0e1c.jpg)