Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've seen in some docs and tutorials:

  • runReader
  • runState
  • runState

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?

like image 257
Lay González Avatar asked Dec 29 '17 05:12

Lay González


1 Answers

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.

like image 112
Yawar Avatar answered Sep 22 '22 21:09

Yawar