-
-
Save lenary/0eaee9cef15d823f2c34 to your computer and use it in GitHub Desktop.
This file contains 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 Main | |
import Prelude.Algebra | |
record GCounter : Type where | |
MkGCounter : (value : Int) -> GCounter | |
gcjoin : GCounter -> GCounter -> GCounter | |
gcjoin l r = (MkGCounter ((value l) + (value r))) | |
gc1 : GCounter | |
gc1 = (MkGCounter 1) | |
gc2 : GCounter | |
gc2 = (MkGCounter 2) | |
instance JoinSemilattice GCounter where | |
join = gcjoin | |
instance VerifiedJoinSemilattice GCounter where | |
joinSemilatticeJoinIsAssociative = ?a | |
joinSemilatticeJoinIsCommutative = ?c | |
joinSemilatticeJoinIsIdempotent = ?i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment