Skip to content

Instantly share code, notes, and snippets.

@jfdm
Created April 22, 2025 20:20
Show Gist options
  • Save jfdm/a4a3ac54ed837628670ef0c8a1e0cd8d to your computer and use it in GitHub Desktop.
Save jfdm/a4a3ac54ed837628670ef0c8a1e0cd8d to your computer and use it in GitHub Desktop.
Who needs first class modules when you can set records...
record Bumpable type where
constructor B
bump : type -> type
myIntBumper : Bumpable Int
myIntBumper
= B (+ 1)
myNatBumper : Bumpable Nat
myNatBumper
= B (+ 1)
doubleBump : Bumpable a
-> a
-> a
doubleBump (B bump) y
= bump (bump y)
test : Equal
(doubleBump Adam.myNatBumper (the Nat 1))
(the Nat 3)
test = Refl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment