diff options
author | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2014-05-05 09:01:03 +0200 |
---|---|---|
committer | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2014-05-05 11:00:41 +0200 |
commit | cc269e6b0b615e9e237c35a985e4ace7b9ab0dd9 (patch) | |
tree | f0264138c81909151f9724c1f02f7bf8b30803cb /src/Haddock/Types.hs | |
parent | 7ac2d0f2d31c2e1c7ede09828f3d5ba5626bd0d4 (diff) |
Move parser + parser tests out to own package.
We move some types out that are necessary as well and then
re-export and specialise them in the core Haddock.
Reason for moving out spec tests is that if we're working on the parser,
we can simply work on that and we can ignore the rest of Haddock. The
downside is that it's a little inconvenient if at the end of the day we
want to see that everything passes.
Diffstat (limited to 'src/Haddock/Types.hs')
-rw-r--r-- | src/Haddock/Types.hs | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index cd615bf4..85b3a592 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -19,16 +19,16 @@ module Haddock.Types ( module Haddock.Types , HsDocString, LHsDocString , Fixity(..) + , module Documentation.Haddock.Types ) where -import Data.Foldable -import Data.Traversable import Control.Exception import Control.Arrow hiding ((<+>)) import Control.DeepSeq import Data.Typeable import Data.Map (Map) import qualified Data.Map as Map +import Documentation.Haddock.Types import BasicTypes (Fixity(..)) import GHC hiding (NoLink) import DynFlags (ExtensionFlag, Language) @@ -316,36 +316,6 @@ type LDoc id = Located (Doc id) type Doc id = DocH (ModuleName, OccName) id -data DocH mod id - = DocEmpty - | DocAppend (DocH mod id) (DocH mod id) - | DocString String - | DocParagraph (DocH mod id) - | DocIdentifier id - | DocIdentifierUnchecked mod - | DocModule String - | DocWarning (DocH mod id) - | DocEmphasis (DocH mod id) - | DocMonospaced (DocH mod id) - | DocBold (DocH mod id) - | DocUnorderedList [DocH mod id] - | DocOrderedList [DocH mod id] - | DocDefList [(DocH mod id, DocH mod id)] - | DocCodeBlock (DocH mod id) - | DocHyperlink Hyperlink - | DocPic Picture - | DocAName String - | DocProperty String - | DocExamples [Example] - | DocHeader (Header (DocH mod id)) - deriving (Functor, Foldable, Traversable) - -instance Foldable Header where - foldMap f (Header _ a) = f a - -instance Traversable Header where - traverse f (Header l a) = Header l `fmap` f a - instance (NFData a, NFData mod) => NFData (DocH mod a) where rnf doc = case doc of @@ -376,23 +346,6 @@ instance NFData Name instance NFData OccName instance NFData ModuleName - -data Hyperlink = Hyperlink - { hyperlinkUrl :: String - , hyperlinkLabel :: Maybe String - } deriving (Eq, Show) - - -data Picture = Picture - { pictureUri :: String - , pictureTitle :: Maybe String - } deriving (Eq, Show) - -data Header id = Header - { headerLevel :: Int - , headerTitle :: id - } deriving Functor - instance NFData id => NFData (Header id) where rnf (Header a b) = a `deepseq` b `deepseq` () @@ -402,13 +355,6 @@ instance NFData Hyperlink where instance NFData Picture where rnf (Picture a b) = a `deepseq` b `deepseq` () - -data Example = Example - { exampleExpression :: String - , exampleResult :: [String] - } deriving (Eq, Show) - - instance NFData Example where rnf (Example a b) = a `deepseq` b `deepseq` () |