Skip to content

Instantly share code, notes, and snippets.

@lenary
Forked from mrb/cong.idr
Created June 25, 2014 14:31
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 lenary/0eaee9cef15d823f2c34 to your computer and use it in GitHub Desktop.
Save lenary/0eaee9cef15d823f2c34 to your computer and use it in GitHub Desktop.
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