From 98faf732052c24766b0abfc38ce6b7178c226a61 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 2 Jan 2022 01:55:17 +0100 Subject: playing around with types --- lib/KindLinter.hs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/KindLinter.hs (limited to 'lib') 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 -- cgit v1.2.3