Skip to content

Instantly share code, notes, and snippets.

@gallais
Created September 1, 2015 12:29
Show Gist options
  • Save gallais/785c0da0829e27d0c1ea to your computer and use it in GitHub Desktop.
Save gallais/785c0da0829e27d0c1ea to your computer and use it in GitHub Desktop.
Making instance resolution loop
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