Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
greener_grass
on Aug 9, 2024
|
parent
|
context
|
favorite
| on:
State Monad for the Rest of Us
Is there are correct way around?
St -> (a, St)
vs
St -> (St, a)
I've found both in the wild and it can be very confusing!
chuckadams
on Aug 9, 2024
|
next
[–]
The order doesn’t matter as long as you’re consistent, but Control.Monad.State uses the first, and you’ll have a bad time (in Haskell anyway) if you’re not compatible with that.
RandomThoughts3
on Aug 9, 2024
|
prev
[–]
It’s the same thing. Order doesn’t matter in the tuple. Just use a bind which is in line with the signature of the type you want to use.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: