Created
December 3, 2010 07:51
-
-
Save ekmett/726694 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
object hom { | |
trait set { | |
type inf | |
type sup >: inf | |
type hom[_>:inf<:sup,_>:inf<:sup] | |
type dual = set.of[inf,sup,({type λ[x>:inf<:sup,y>:inf<:sup]=hom[y,x]})#λ] | |
} | |
object set { | |
trait of[l,h>:l,c[_>:l<:h,_>:l<:h]] extends set { | |
type inf = l | |
type sup = h | |
type hom[x>:inf<:sup,y>:inf<:sup] = c[x,y] | |
} | |
trait singleton[z] extends of[Nothing,Nothing,({type λ[x>:Nothing<:Nothing,y>:Nothing<:Nothing]=z})#λ] | |
} | |
} | |
trait category[h <: hom.set] { | |
def id[A>:h#inf<:h#sup]: h#hom[A,A] | |
def compose[A>:h#inf<:h#sup, B>:h#inf<:h#sup, C>:h#inf<:h#sup](f : h#hom[B,C], g: h#hom[A,B]) : h#hom[A,C] | |
type dual = category[h#dual] | |
def dual : dual | |
} | |
<console>:9: error: type arguments [y,x] do not conform to type hom's type parameter bounds [_ >: set.this.inf <: set.this.sup,_ >: set.this.inf <: set.this.sup] | |
type dual = category[h#dual] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment