Created
July 28, 2017 09:18
-
-
Save useronym/4221766151007abb58998cfb951737c7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
open import Data.String | |
record Print (A : Set) : Set where | |
field | |
print : A → String | |
open Print {{…}} public | |
mutual | |
data α : Set where | |
begin : α | |
step-α : β → α | |
data β : Set where | |
step-β : α → β | |
example : α | |
example = step-α (step-β begin) | |
mutual | |
instance | |
print-α : Print α | |
print-β : Print β | |
print-α = record { print = λ {begin → "." | |
; (step-α b) → "a" ++ (print b)} } | |
print-β = record { print = λ {(step-β a) → "b" ++ (print a)} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment