summaryrefslogtreecommitdiff
path: root/tests/examples/pre-ghc86/LiftedConstructors.hs
diff options
context:
space:
mode:
authorAlanZimmerman <>2018-07-11 21:23:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-07-11 21:23:00 (GMT)
commitacc46b7da4e695bf357c5fb5f311382686c1d105 (patch)
treebc910d39de1e7435ede8d8fbb6b8c28ac36f01c3 /tests/examples/pre-ghc86/LiftedConstructors.hs
parentb6934f22d6668ed1ee60bca7a5382e4288426984 (diff)
version 0.5.7.00.5.7.0
Diffstat (limited to 'tests/examples/pre-ghc86/LiftedConstructors.hs')
-rw-r--r--tests/examples/pre-ghc86/LiftedConstructors.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/examples/pre-ghc86/LiftedConstructors.hs b/tests/examples/pre-ghc86/LiftedConstructors.hs
new file mode 100644
index 0000000..af14b4a
--- /dev/null
+++ b/tests/examples/pre-ghc86/LiftedConstructors.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE DataKinds, TypeOperators, GADTs #-}
+
+give :: b -> Pattern '[b] a
+give b = Pattern (const (Just $ oneT b))
+
+
+pfail :: Pattern '[] a
+pfail = is (const False)
+
+(/\) :: Pattern vs1 a -> Pattern vs2 a -> Pattern (vs1 :++: vs2) a
+(/\) = mk2 (\a -> Just (a,a))
+
+data Pattern :: [*] -> * where
+ Nil :: Pattern '[]
+ Cons :: Maybe h -> Pattern t -> Pattern (h ': t)
+
+type Pos = '("vpos", V3 GLfloat)
+type Tag = '("tagByte", V1 Word8)
+
+-- | Alias for the 'In' type from the 'Direction' kind, allows users to write
+-- the 'BroadcastChan In a' type without enabling DataKinds.
+type In = 'In
+-- | Alias for the 'Out' type from the 'Direction' kind, allows users to write
+-- the 'BroadcastChan Out a' type without enabling DataKinds.
+type Out = 'Out