Skip to content

Instantly share code, notes, and snippets.

@jespercockx
Created March 22, 2023 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jespercockx/fc6492bcd29816f2ee9d6d9bec6bdc53 to your computer and use it in GitHub Desktop.
Save jespercockx/fc6492bcd29816f2ee9d6d9bec6bdc53 to your computer and use it in GitHub Desktop.
open import Agda.Builtin.Unit
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
record Add (A : Set) : Set where
field
add : A → A → A
open Add {{...}}
instance
instAddNat : Add Nat
instAddNat .add = _+_
instance
instAddUnit : Add ⊤
instAddUnit .add _ _ = _
test : (x y : Nat) → add x y ≡ add _ _
test x y = refl
{-
———— Errors ————————————————————————————————————————————————
Failed to solve the following constraints:
_14 (x = x) (y = y) + _15 (x = x) (y = y) = x + y : Nat
(blocked on _14)
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment