Safe Haskell | None |
---|---|
Language | Haskell2010 |
CabalGild.Unstable.Action.EvaluatePragmas
Synopsis
- run :: (MonadThrow m, MonadWalk m) => FilePath -> ([Field (p, [Comment q])], cs) -> m ([Field (p, [Comment q])], cs)
- field :: (MonadThrow m, MonadWalk m) => FilePath -> Field (p, [Comment q]) -> m (Field (p, [Comment q]))
- discover :: forall (m :: Type -> Type) p c. (MonadThrow m, MonadWalk m) => FilePath -> Name (p, [c]) -> [FieldLine (p, [c])] -> DiscoverTarget -> [String] -> MaybeT m (Field (p, [c]))
- clean :: FilePath -> FilePath
- relevantFieldNames :: Map FieldName DiscoverTarget
- stripAnyExtension :: Set String -> FilePath -> Maybe String
- extensions :: Set String
- toModuleName :: [FilePath] -> FilePath -> Maybe ModuleName
- hoistMaybe :: forall (f :: Type -> Type) a. Applicative f => Maybe a -> MaybeT f a
Documentation
run :: (MonadThrow m, MonadWalk m) => FilePath -> ([Field (p, [Comment q])], cs) -> m ([Field (p, [Comment q])], cs) Source #
High level wrapper around field
that makes this action easier to compose
with other actions.
field :: (MonadThrow m, MonadWalk m) => FilePath -> Field (p, [Comment q]) -> m (Field (p, [Comment q])) Source #
Evaluates pragmas within the given field. Or, if the field is a section, evaluates pragmas recursively within the fields of the section.
discover :: forall (m :: Type -> Type) p c. (MonadThrow m, MonadWalk m) => FilePath -> Name (p, [c]) -> [FieldLine (p, [c])] -> DiscoverTarget -> [String] -> MaybeT m (Field (p, [c])) Source #
If modules are discovered for a field, that fields lines are completely replaced.
clean :: FilePath -> FilePath Source #
Converts separators into POSIX format and then normalizes the result.
relevantFieldNames :: Map FieldName DiscoverTarget Source #
These are the names of the fields that can have this action applied to them.
stripAnyExtension :: Set String -> FilePath -> Maybe String Source #
Attempts to strip any of the given extensions from the file path. If any
of them succeed, the result is returned. Otherwise Nothing
is returned.
extensions :: Set String Source #
The set of extensions that should be discovered by this pragma. Any file with one of these extensions will be discovered.
toModuleName :: [FilePath] -> FilePath -> Maybe ModuleName Source #
Attempts to convert a file path (without an extension) into a module name by making it relative to one of the given directories.
hoistMaybe :: forall (f :: Type -> Type) a. Applicative f => Maybe a -> MaybeT f a Source #
This was added in transformers-0.6.0.0
. See
https://hub.darcs.net/ross/transformers/issue/49.