Created
January 18, 2012 04:49
-
-
Save imeredith/1631034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Category[~>[_, _]] { | |
def compose[A, B, C](f: B ~> C)(g: A ~> B): A ~> C | |
def id[A]: A ~> A | |
} | |
case class Lens[A, B]( | |
get: A => B | |
, set: (A, B) => A | |
) | |
object Category { | |
val Function1Category: Category[Function1] = new Category[Function1] { | |
def compose[A, B, C](f: B ~> C)(g: A ~> B) = f compose g | |
def id[A] = a => a | |
} | |
val LensCategory: Category[Lens] = | |
sys.error("todo") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment