sop → elab-util
This commit is contained in:
parent
04d3c9368a
commit
fc3c2dc8ab
9 changed files with 40 additions and 31 deletions
|
@ -6,18 +6,17 @@ import Quox.Pretty
|
|||
|
||||
import Decidable.Equality
|
||||
import Control.Function
|
||||
import Generics.Derive
|
||||
import Derive.Prelude
|
||||
|
||||
%default total
|
||||
%language ElabReflection
|
||||
%hide SOP.from; %hide SOP.to
|
||||
|
||||
|
||||
public export
|
||||
data DimConst = Zero | One
|
||||
%name DimConst e
|
||||
|
||||
%runElab derive "DimConst" [Generic, Meta, Eq, Ord, DecEq, Show]
|
||||
%runElab derive "DimConst" [Eq, Ord, Show]
|
||||
|
||||
||| `ends l r e` returns `l` if `e` is `Zero`, or `r` if it is `One`.
|
||||
public export
|
||||
|
|
|
@ -2,7 +2,7 @@ module Quox.Syntax.Qty.Three
|
|||
|
||||
import Quox.Pretty
|
||||
import public Quox.Syntax.Qty
|
||||
import Generics.Derive
|
||||
import Derive.Prelude
|
||||
|
||||
%default total
|
||||
%language ElabReflection
|
||||
|
@ -12,7 +12,7 @@ public export
|
|||
data Three = Zero | One | Any
|
||||
%name Three pi, rh
|
||||
|
||||
%runElab derive "Three" [Generic, Meta, Eq, Ord, DecEq, Show]
|
||||
%runElab derive "Three" [Eq, Ord, Show]
|
||||
|
||||
|
||||
export
|
||||
|
@ -23,6 +23,18 @@ PrettyHL Three where
|
|||
One => ifUnicode "𝟭" "1"
|
||||
Any => ifUnicode "𝛚" "*"
|
||||
|
||||
public export
|
||||
DecEq Three where
|
||||
decEq Zero Zero = Yes Refl
|
||||
decEq Zero One = No $ \case _ impossible
|
||||
decEq Zero Any = No $ \case _ impossible
|
||||
decEq One Zero = No $ \case _ impossible
|
||||
decEq One One = Yes Refl
|
||||
decEq One Any = No $ \case _ impossible
|
||||
decEq Any Zero = No $ \case _ impossible
|
||||
decEq Any One = No $ \case _ impossible
|
||||
decEq Any Any = Yes Refl
|
||||
|
||||
|
||||
public export
|
||||
plus : Three -> Three -> Three
|
||||
|
|
|
@ -3,7 +3,7 @@ module Quox.Syntax.Universe
|
|||
import Quox.Pretty
|
||||
|
||||
import Data.Fin
|
||||
import Generics.Derive
|
||||
import Derive.Prelude
|
||||
|
||||
%default total
|
||||
%language ElabReflection
|
||||
|
@ -15,7 +15,7 @@ public export
|
|||
data Universe = U Nat | UAny
|
||||
%name Universe l
|
||||
|
||||
%runElab derive "Universe" [Generic, Meta, Eq, Ord, DecEq, Show]
|
||||
%runElab derive "Universe" [Eq, Ord, Show]
|
||||
|
||||
export
|
||||
PrettyHL Universe where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue