Better names for evalState and execState
tomjaguarpaw opened this issue · comments
tomjaguarpaw commented
Ignat Insarov commented
Yep, I can never tell which one does what.
How about getFinalState
and getReturnValue
?
By the way, State
is a tuple, and a tuple is a non-empty container, and a non-empty container is a comonad. Therefore, should getReturnValue
be called extract: State state value → value
?
tomjaguarpaw commented
To start with, let's remember this mnemonic device: "evalState
is invaluable" because it can be used to replicate execState
(but not vice versa).
Matthijs commented
This is how I have been remembering them:
runState
is the one from the record (inferrable from prefix run-)evalSatte
yields a value – just like regular evaluationexecState
is the other one