aboutsummaryrefslogtreecommitdiff
path: root/src/HSVIS/AST.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-03-01 22:25:02 +0100
committerTom Smeding <tom@tomsmeding.com>2024-03-01 22:25:02 +0100
commite8f09ff3f9d40922238d646c8fbcbacf9cfdfb62 (patch)
treeec1b118a1f50efbb74c6d9de503380f76ad5f776 /src/HSVIS/AST.hs
parente094e3294e9c93fd1123b008a4b0e5f53915f5be (diff)
Little typecheck work
Diffstat (limited to 'src/HSVIS/AST.hs')
-rw-r--r--src/HSVIS/AST.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/HSVIS/AST.hs b/src/HSVIS/AST.hs
index a789c82..f95a3cc 100644
--- a/src/HSVIS/AST.hs
+++ b/src/HSVIS/AST.hs
@@ -141,6 +141,12 @@ data Operator = OAdd | OSub | OMul | ODiv | OMod | OEqu | OPow
instance Pretty Name where
prettysPrec _ (Name n) = showString ("\"" ++ n ++ "\"")
+instance (X Kind s ~ (), Pretty (E Kind s)) => Pretty (Kind s) where
+ prettysPrec _ (KType ()) = showString "Type"
+ prettysPrec d (KFun () a b) =
+ showParen (d > -1) $ prettysPrec 0 a . showString " -> " . prettysPrec 0 b
+ prettysPrec d (KExt () e) = prettysPrec d e
+
instance HasExt DataDef where
type HasXField DataDef = 'True
type HasECon DataDef = 'False