Skip to content

Instantly share code, notes, and snippets.

@lancegatlin
Created April 24, 2017 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lancegatlin/56f5207d52174b690572e7d2f932967e to your computer and use it in GitHub Desktop.
Save lancegatlin/56f5207d52174b690572e7d2f932967e to your computer and use it in GitHub Desktop.
Exec type-class
trait Exec[F[_]] extends Monad[F] {
/**
Execute a block of code in in the context of F
F may execute code block asynchronously, synchronously or may suspend execution.
Note: if F suspends execution, this typeclass does not define how to execute the suspended code
F may capture effects or may not capture effects
F may catch exceptions or may not catch exceptions
*/
def exec(f: => A) : F[A]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment