Skip to content

Instantly share code, notes, and snippets.

@seanparsons
Created July 6, 2013 20:48
Show Gist options
  • Save seanparsons/5941234 to your computer and use it in GitHub Desktop.
Save seanparsons/5941234 to your computer and use it in GitHub Desktop.
Possible route to make for comprehensions stricter and powered by scalaz.Monad.
def strictFor[M[+_], T](forExp: M[T])(implicit mMonad: Monad[M]): M[T] = macro strictForImpl[M, T]
def strictForImpl[M[+_]: c.WeakTypeTag, T: c.WeakTypeTag](c: Context)(forExp: c.Expr[M[T]])(mMonad: c.Expr[Monad[M]]): c.Expr[M[T]] = {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment