summaryrefslogtreecommitdiff
path: root/lib/KindLinter.hs
diff options
context:
space:
mode:
authorstuebinm2022-01-02 01:55:17 +0100
committerstuebinm2022-03-19 19:23:08 +0100
commit6e929b4b1eb9b0b6a4707ed3d9f181544ed27a73 (patch)
tree79e82e44f17f889959ccd4e27eeb8f3604ec7811 /lib/KindLinter.hs
parentc9c472a36b0db933771a6feb24709e78cae1822b (diff)
playing around with types
Diffstat (limited to '')
-rw-r--r--lib/KindLinter.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/KindLinter.hs b/lib/KindLinter.hs
new file mode 100644
index 0000000..4ecf067
--- /dev/null
+++ b/lib/KindLinter.hs
@@ -0,0 +1,29 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE TypeApplications #-}
+
+module KindLinter where
+
+import Data.Map.Strict
+import Data.HList
+import GHC.TypeLits (Symbol, KnownSymbol)
+
+
+func :: a -> HList [Int, String]
+func _ = hBuild 10 "test"
+
+field :: forall a. KnownSymbol a => Label a
+field = Label
+
+
+record =
+ Label @"test" .=. 10 .*.
+ field @"x" .=. 20 .*.
+ emptyRecord
+
+-- TODO: these should be limited to Tagged "symbol" (LintWriter a)
+tileLints =
+ field @"test" .=. (\a -> a) .*.
+ emptyRecord