quox/lib/Quox/Typing/EqMode.idr

23 lines
409 B
Idris
Raw Normal View History

2023-03-13 16:41:57 -04:00
module Quox.Typing.EqMode
import Quox.Syntax
import Derive.Prelude
%language ElabReflection
%default total
public export
data EqMode = Equal | Sub | Super
%runElab derive "EqMode" [Eq, Ord, Show]
export %inline
ucmp : EqMode -> Universe -> Universe -> Bool
ucmp Equal = (==)
ucmp Sub = (<=)
ucmp Super = (>=)
export %inline
flip : EqMode -> EqMode
flip Equal = Equal
flip Sub = Super
flip Super = Sub