It seems that Haskell has established several naming conventions around monads.
Examples:
- appending
Tto the end to obtain the name of the monad transformer (e.g.Reader->ReaderT) - using
runXXXto perform a monad computation (e.g.runST,runReader) liftXXXfor various values ofXXX
Are there other naming conventions?
runX mwherem :: X awill run theXmonad and return the “side effect” along with the monad result,a.evalX mwill run the computation and return the result,a.execX mwill run the computation and return the “side effect” but not the result.The lifts come in various flavors that can be a bit too tricky for me to want to explain them in a SO answer. You should probably know
liftandliftIOand be aware of / eventually seek out the other variants such asliftWithandliftBaseWith. See, for example, EZYang’s posting on the topic.appending a
Tafter the monad name implies transformer. Appending anMafter a function name implies it is monadic. Appending an_implies the result is ignored.All other suffixed letters mean “use hoogle”.