[1 of 3] Compiling Hidden ( Hidden.hs, Hidden.o ) ==================== Parser ==================== module Hidden where hidden :: Int -> Int hidden a = a [2 of 3] Compiling Visible ( Visible.hs, Visible.o ) ==================== Parser ==================== module Visible where visible :: Int -> Int visible a = a [3 of 3] Compiling Test ( Test.hs, Test.o ) ==================== Parser ==================== -- | -- Module : Test -- Copyright : (c) Simon Marlow 2002 -- License : BSD-style -- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability : portable -- -- This module illustrates & tests most of the features of Haddock. -- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. -- module Test ( , , T(..), T2, T3(..), T4(..), T5(..), T6(..), N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), , R(..), R1(..), test that we can export record selectors on their own:, p, q, u, , C(a, b), D(..), E, F(..), Test that we can export a class method on its own:, a, , f, g, , , , , , , , , , , , , , This is some inline documentation in the export list > a code block using bird-tracks > each line must begin with > (which isn't significant unless it > is at the beginning of the line)., , module Hidden, , module Visible, nested-style doc comments , , Ex(..), , k, l, m, o, , , > a literal line $ a non /literal/ line $ , f' ) where import Hidden import Visible data T a b = -- | This comment describes the 'A' constructor A Int (Maybe Float) | -- | This comment describes the 'B' constructor B (T a b, T Int Float) data T2 a b = T2 a b data T3 a b = A1 a | B1 b data T4 a b = A2 a | B2 b data T5 a b = -- | documents 'A3' A3 a | -- | documents 'B3' B3 b data T6 = -- | This is the doc for 'A4' A4 | -- | This is the doc for 'B4' B4 | -- | This is the doc for 'C4' C4 newtype N1 a = N1 a newtype N2 a b = N2 {n :: a b} newtype N3 a b = N3 {-- | this is the 'n3' field n3 :: a b} newtype N4 a b = N4 a newtype N5 a b = N5 {-- | no docs on the datatype or the constructor n5 :: a b} newtype N6 a b = -- | docs on the constructor only N6 {n6 :: a b} newtype N7 a b = -- | The 'N7' constructor N7 {n7 :: a b} class (D a) => C a where a :: IO a b :: [a] c :: a class D a where d :: T a b e :: (a, a) instance D Int where d = undefined e = undefined instance Test.D Float where d = undefined e = undefined class E a where ee :: a class F a where ff :: a data R = -- | This is the 'C1' record constructor, with the following fields: C1 {-- | This comment applies to the 'p' field p :: Int, -- | This comment applies to the 'q' field q :: forall a. a -> a, -- | This comment applies to both 'r' and 's' r, s :: Int} | -- | This is the 'C2' record constructor, also with some fields: C2 {t :: T1 -> (T2 Int Int) -> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), u, v :: Int} data R1 = -- | This is the 'C3' record constructor C3 {-- | The 's1' record selector s1 :: Int, -- | The 's2' record selector s2 :: Int, -- | The 's3' record selector s3 :: Int} f :: C a => a -> Int foreign import ccall safe "header.h" g :: Int -> IO CInt h :: Int h = 42 data Ex a = forall b. C b => Ex1 b | forall b. Ex2 b | forall b. C a => Ex3 b | Ex4 (forall a. a -> a) k :: -- | This argument has type 'T' T () () -> -- | This argument has type 'T2 Int Int' (T2 Int Int) -> -- | This argument has type @T3 Bool Bool -> T4 Float Float@ (T3 Bool Bool -> T4 Float Float) -> -- | This argument has a very long description that should -- hopefully cause some wrapping to happen when it is finally -- rendered by Haddock in the generated HTML page. T5 () () -> -- | This is the result type IO () l :: -- | takes a triple (Int, Int, Float) -> -- | returns an 'Int' Int m :: R -> -- | one of the arguments N1 () -> -- | and the return value IO Int newn :: -- | one of the arguments, an 'R' R -> -- | one of the arguments N1 () -> IO Int newn = undefined foreign import ccall unsafe "header.h" o :: -- | The input float Float -> -- | The output float IO Float newp :: Int newp = undefined f' :: Int data T1 f = undefined f' = undefined type CInt = Int k = undefined l = undefined m = undefined Test.hs:33:9: warning: [GHC-47854] [-Wduplicate-exports (in -Wdefault)] ‘p’ is exported by ‘p’ and ‘R(..)’ Test.hs:33:12: warning: [GHC-47854] [-Wduplicate-exports (in -Wdefault)] ‘q’ is exported by ‘q’ and ‘R(..)’ Test.hs:33:15: warning: [GHC-47854] [-Wduplicate-exports (in -Wdefault)] ‘u’ is exported by ‘u’ and ‘R(..)’ Test.hs:39:9: warning: [GHC-47854] [-Wduplicate-exports (in -Wdefault)] ‘a’ is exported by ‘a’ and ‘C(a, b)’