summaryrefslogtreecommitdiff
path: root/src/Data.hs
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2024-01-25 17:25:32 +0100
committerTom Smeding <t.j.smeding@uu.nl>2024-01-25 17:25:32 +0100
commit39b899b4951be5b78058d5c0e35977b065a63951 (patch)
tree787a7f68a111513c890e141cda215331189535db /src/Data.hs
parent11ad6ad3f4ff2c3aa8eaff4d6124f361716cafff (diff)
Getting further
Diffstat (limited to 'src/Data.hs')
-rw-r--r--src/Data.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Data.hs b/src/Data.hs
new file mode 100644
index 0000000..bd7f3af
--- /dev/null
+++ b/src/Data.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE QuantifiedConstraints #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TypeOperators #-}
+module Data where
+
+
+data SList f l where
+ SNil :: SList f '[]
+ SCons :: f a -> SList f l -> SList f (a : l)
+deriving instance (forall a. Show (f a)) => Show (SList f l)
+infixr `SCons`
+
+slistMap :: (forall t. f t -> g t) -> SList f list -> SList g list
+slistMap _ SNil = SNil
+slistMap f (SCons x list) = SCons (f x) (slistMap f list)