mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 20:23:11 +03:00
28 lines
348 B
Idris
28 lines
348 B
Idris
data D = MkD
|
|
data E = MkE
|
|
|
|
data Proxy i = MkProxy
|
|
|
|
interface I i where
|
|
(.idot) : i -> Int
|
|
|
|
I D where
|
|
(.idot) _ = 0
|
|
|
|
interface J i where
|
|
theInt : Proxy i -> Int
|
|
|
|
(.jdot) : i -> Int
|
|
(.jdot) _ = theInt (the (Proxy i) MkProxy)
|
|
|
|
val : i -> Int
|
|
val v = 10 + v .jdot
|
|
|
|
J D where
|
|
theInt _ = 0
|
|
|
|
J E where
|
|
theInt _ = 0
|
|
(.jdot) _ = 1
|
|
val _ = 2
|