Search code examples
haskellnewtype

What is the meaning for the convention "runSomething" in the Haskell community?


I've seen in some docs and tutorials:

What is the abstract concept that this pattern covers? What does running something mean in Haskell?

Side question, is there a tag for things you always wanted to know but were too afraid to ask?


Solution

  • In Haskell, the convention runSomething means 'execute the effects described inside the given argument, and return the resulting value'.

    I purposely said 'effects' because I was being fuzzy; in Haskell you use the type system to describe different effects that might happen, like doing I/O, or modifying state, etc. So depending on the exact type, different effects might be run before the final value is returned.