Created
September 1, 2015 12:29
-
-
Save gallais/785c0da0829e27d0c1ea to your computer and use it in GitHub Desktop.
Making instance resolution loop
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
module InstanceLoop where | |
record Target (A : Set) : Set where | |
constructor mkTarget | |
field | |
a : A | |
instance | |
loop : {A : Set} {{tA : Target A}} → Target A | |
loop {{tA}} = tA | |
open import Data.Nat | |
extract : {A : Set} {{tA : Target A}} → A | |
extract {{tA}} = Target.a tA | |
argh! : ℕ | |
argh! = extract |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment