22 lines
409 B
Idris
22 lines
409 B
Idris
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
|