Skip to content

Instantly share code, notes, and snippets.

@patrickaldis
Created August 3, 2022 10:53
Show Gist options
  • Save patrickaldis/c558462807df01df03cfcca0206d41c8 to your computer and use it in GitHub Desktop.
Save patrickaldis/c558462807df01df03cfcca0206d41c8 to your computer and use it in GitHub Desktop.
Monad Help

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

@patrickaldis
Copy link
Author

Notes for Task 9:
0583b5cd-7d08-478d-9cb4-720541ad2083
0af425d2-b244-40d9-9343-d23fad19d0f0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment