doctest-parallel-0.4: Test interactive Haskell examples

Safe Haskell | None
Language | Haskell2010

Test.DocTest.Internal.Extract

Synopsis

- data Module a = Module {
  - moduleName :: String
  - moduleSetup :: Maybe a
  - moduleContent :: [a]
  - moduleConfig :: [Located String]
  }
- isEmptyModule :: Module a -> Bool
- extract :: String -> Ghc (Module (Located String))
- extractIO :: [String] -> String -> IO (Module (Located String))
- eraseConfigLocation :: Module a -> Module a

# Documentation

data Module a Source #

Documentation for a module grouped together with the modules name.

Constructors

Module |

Fields

- moduleName :: String
- moduleSetup :: Maybe a
- moduleContent :: [a]
- moduleConfig :: [Located String]

#### Instances

Instances details

Functor Module Source # |
Instance details Defined in Test.DocTest.Internal.Extract Methods fmap :: (a -> b) -> Module a -> Module b Source # (<$) :: a -> Module b -> Module a Source #
NFData a => NFData (Module a) Source # |
Instance details Defined in Test.DocTest.Internal.Extract Methods rnf :: Module a -> () Source #
Generic (Module a) Source # |

Instance details

Defined in Test.DocTest.Internal.Extract

Associated Types

type Rep (Module a) |

Instance details

Defined in Test.DocTest.Internal.Extract

type Rep (Module a) = D1 ('MetaData "Module" "Test.DocTest.Internal.Extract" "doctest-parallel-0.4-Ku6xlKqGqCgHDSZeb8KTkx" 'False) (C1 ('MetaCons "Module" 'PrefixI 'True) ((S1 ('MetaSel ('Just "moduleName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "moduleSetup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe a))) :*: (S1 ('MetaSel ('Just "moduleContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a]) :*: S1 ('MetaSel ('Just "moduleConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located String]))))

Methods

from :: Module a -> Rep (Module a) x Source #

to :: Rep (Module a) x -> Module a Source #

Show a => Show (Module a) Source # |
Instance details Defined in Test.DocTest.Internal.Extract Methods showsPrec :: Int -> Module a -> ShowS Source # show :: Module a -> String Source # showList :: [Module a] -> ShowS Source #
Eq a => Eq (Module a) Source # |
Instance details Defined in Test.DocTest.Internal.Extract Methods (==) :: Module a -> Module a -> Bool Source # (/=) :: Module a -> Module a -> Bool Source #
type Rep (Module a) Source # |

Instance details

Defined in Test.DocTest.Internal.Extract

type Rep (Module a) = D1 ('MetaData "Module" "Test.DocTest.Internal.Extract" "doctest-parallel-0.4-Ku6xlKqGqCgHDSZeb8KTkx" 'False) (C1 ('MetaCons "Module" 'PrefixI 'True) ((S1 ('MetaSel ('Just "moduleName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "moduleSetup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe a))) :*: (S1 ('MetaSel ('Just "moduleContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a]) :*: S1 ('MetaSel ('Just "moduleConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located String]))))

isEmptyModule :: Module a -> Bool Source #

extract :: String -> Ghc (Module (Located String)) Source #

Extract all docstrings from given list of files/modules.

This includes the docstrings of all local modules that are imported from those modules (possibly indirect).

Can throw `ExtractError` if an error occurs while extracting the docstrings, or a `SourceError` if an error occurs while parsing the module. Can throw a `ModuleNotFoundError` if a module's source file cannot be found.

extractIO :: [String] -> String -> IO (Module (Located String)) Source #

Like `extract`, but runs in the `IO` monad given GHC parse arguments.

eraseConfigLocation :: Module a -> Module a Source #