aboutsummaryrefslogtreecommitdiff
path: root/latex-test/src/TypeFamilies3
diff options
context:
space:
mode:
Diffstat (limited to 'latex-test/src/TypeFamilies3')
-rw-r--r--latex-test/src/TypeFamilies3/TypeFamilies3.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/latex-test/src/TypeFamilies3/TypeFamilies3.hs b/latex-test/src/TypeFamilies3/TypeFamilies3.hs
new file mode 100644
index 00000000..bde05fb8
--- /dev/null
+++ b/latex-test/src/TypeFamilies3/TypeFamilies3.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module TypeFamilies3 where
+
+-- | A closed type family
+type family Foo a where
+ Foo () = Int
+ Foo _ = ()
+
+-- | An open family
+type family Bar a
+
+type instance Bar Int = ()
+type instance Bar () = Int
+
+-- | A data family
+data family Baz a
+
+data instance Baz () = Baz1
+data instance Baz Int = Baz2 Bool
+newtype instance Baz Double = Baz3 Float