tilapia icon indicating copy to clipboard operation
tilapia copied to clipboard

Better names for evalState and execState

Open tomjaguarpaw opened this issue 3 years ago • 3 comments

tomjaguarpaw avatar Oct 26 '22 13:10 tomjaguarpaw

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?

kindaro avatar Nov 08 '22 19:11 kindaro

To start with, let's remember this mnemonic device: "evalState is invaluable" because it can be used to replicate execState (but not vice versa).

tomjaguarpaw avatar Dec 29 '22 09:12 tomjaguarpaw

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 evaluation
  • execState is the other one

MatthijsBlom avatar Dec 29 '22 11:12 MatthijsBlom