aboutsummaryrefslogtreecommitdiff
path: root/html-test/src
diff options
context:
space:
mode:
Diffstat (limited to 'html-test/src')
-rw-r--r--html-test/src/Bug745.hs8
-rw-r--r--html-test/src/ConstructorArgs.hs56
-rw-r--r--html-test/src/GadtConstructorArgs.hs13
-rw-r--r--html-test/src/QuantifiedConstraints.hs11
-rw-r--r--html-test/src/Unicode2.hs18
5 files changed, 106 insertions, 0 deletions
diff --git a/html-test/src/Bug745.hs b/html-test/src/Bug745.hs
new file mode 100644
index 00000000..f26562c1
--- /dev/null
+++ b/html-test/src/Bug745.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}
+
+module Bug574 where
+-- See https://github.com/haskell/haddock/issues/574
+
+-- | Somthing with a spliced type
+foo :: Int -> $(let i = [t| Int |] in [t| $i -> $i |])
+foo x y = x + y
diff --git a/html-test/src/ConstructorArgs.hs b/html-test/src/ConstructorArgs.hs
new file mode 100644
index 00000000..6b0da711
--- /dev/null
+++ b/html-test/src/ConstructorArgs.hs
@@ -0,0 +1,56 @@
+{-# LANGUAGE GADTs, PatternSynonyms #-}
+
+module ConstructorArgs (Foo(..), Boo(Foo, Foa, Fo, Fo'), pattern Bo, pattern Bo') where
+
+data Foo
+ = Rec -- ^ doc on a record
+ { x :: String -- ^ doc on the `String` field of `Rec`
+ , y :: String -- ^ doc on the `String` field of `Rec`
+ }
+ | Baz Int String -- ^ old prefix doc style
+ | Boa -- ^ doc on the `Boa` constrictor
+ !Int -- ^ doc on the `Int` field of `Boa`
+ !String -- ^ doc on the `String` field of `Boa`
+ | Int :| String -- ^ old infix doc style
+ | Int -- ^ doc on the `Int` field of the `:*` constructor
+ :* -- ^ doc on the `:*` constructor
+ String -- ^ doc on the `String` field of the `:*` constructor
+
+infixr 1 `Foo`
+infixr 2 `Boa`
+infixr 3 :*
+
+data Boo where
+ -- | Info about a 'Foo'
+ Foo :: Int -- ^ `Int` field of `Foo`
+ -> String -- ^ `String` field of `Foo`
+ -> Boo -- ^ Make a `Boo`
+
+ -- | no argument docs GADT
+ Foa :: Int -> Boo
+
+infixr 4 `Boo`
+
+-- | Info about bundled 'Fo'
+pattern Fo :: Int -- ^ an 'Int'
+ -> String -- ^ a 'String'
+ -> Boo -- ^ a 'Boo'
+pattern Fo x y = Foo x y
+
+-- | Bundled and no argument docs
+pattern Fo' :: Boo
+pattern Fo' = Foo 1 "hi"
+
+infixr 5 `Fo`
+
+-- | Info about not-bundled 'Bo'
+pattern Bo :: Int -- ^ an 'Int'
+ -> String -- ^ a 'String'
+ -> Boo -- ^ a 'Boo' pattern
+pattern Bo x y = Foo x y
+
+-- | Not bunded and no argument docs
+pattern Bo' :: Int -> String -> Boo
+pattern Bo' x y = Foo x y
+
+infixr 6 `Bo`
diff --git a/html-test/src/GadtConstructorArgs.hs b/html-test/src/GadtConstructorArgs.hs
new file mode 100644
index 00000000..79ffb4d3
--- /dev/null
+++ b/html-test/src/GadtConstructorArgs.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE GADTs, PatternSynonyms #-}
+
+module GadtConstructorArgs (Boo(..)) where
+
+data Boo where
+ Fot :: { x :: Int -- ^ an 'x'
+ , y :: Int -- ^ a 'y'
+ } -> Boo
+
+ -- | Record GADT with docs
+ Fob :: { w :: Int -- ^ a 'w'
+ , z :: Int -- ^ a 'z'
+ } -> Boo -- ^ a 'Boo'
diff --git a/html-test/src/QuantifiedConstraints.hs b/html-test/src/QuantifiedConstraints.hs
new file mode 100644
index 00000000..82dd81e5
--- /dev/null
+++ b/html-test/src/QuantifiedConstraints.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE QuantifiedConstraints #-}
+module QuantifiedConstraints where
+
+class Foo a where
+ fooed :: a
+
+needsParensAroundContext :: (forall x. Foo (f x)) => f Int
+needsParensAroundContext = fooed
+
+needsNoParensAroundContext :: Foo (f Int) => f Int
+needsNoParensAroundContext = fooed
diff --git a/html-test/src/Unicode2.hs b/html-test/src/Unicode2.hs
new file mode 100644
index 00000000..ca6b18ba
--- /dev/null
+++ b/html-test/src/Unicode2.hs
@@ -0,0 +1,18 @@
+module Unicode2 where
+
+-- | All of the following work with a unicode character ü:
+--
+-- * an italicized /ü/
+--
+-- * inline code @ü@
+--
+-- * a code block:
+--
+-- > ü
+--
+-- * a url <https://www.google.com/search?q=ü>
+--
+-- * a link to 'ü'
+--
+ü :: ()
+ü = ()