Skip to content

Instantly share code, notes, and snippets.

Created June 2, 2016 06:24
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 anonymous/b074c4ee5d0b9068b619e8b0f185acd6 to your computer and use it in GitHub Desktop.
Save anonymous/b074c4ee5d0b9068b619e8b0f185acd6 to your computer and use it in GitHub Desktop.
the description for this gist
object PenInterpreterId extends (PencilInstruction ~> Id) {
def apply[A](fa: PencilInstruction[A]): Id[A] = fa match {
case PencilUp(p) => println(s"stop drawing at position $p")
case PencilDown(p) => println(s"start drawing at position $p")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment