aboutsummaryrefslogtreecommitdiff
path: root/html-test/src
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-08-04 11:51:30 -0400
committerAlec Theriault <alec.theriault@gmail.com>2018-10-16 16:28:55 -0700
commit9f2d1b933897a6330e5c8f9fa904e56ab40050ef (patch)
tree171681a8bd3ea2437f029fdf88fa8336efcd712f /html-test/src
parent41d9846754cdccb82e667ece2f44725ed9cab4e7 (diff)
Latex type families (#734)
* Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests
Diffstat (limited to 'html-test/src')
-rw-r--r--html-test/src/TypeFamilies3.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/html-test/src/TypeFamilies3.hs b/html-test/src/TypeFamilies3.hs
new file mode 100644
index 00000000..bde05fb8
--- /dev/null
+++ b/html-test/src/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