Extensions.Package

extensions-0.1.0.2: Parse Haskell Language Extensions

Copyright | (c) 2020-2022 Kowainik
License | MPL-2.0
Maintainer | Kowainik <xrom.xkov@gmail.com>
Safe Haskell | None
Language | Haskell2010

Extensions.Package

Contents

- Package modules
- Single module

Description

Parse Haskell Language Extensions.

Synopsis

- getPackageExtentions :: FilePath -> IO (Map FilePath ExtensionsResult)
- getPackageExtentionsBySources :: FilePath -> Map FilePath ByteString -> IO (Map FilePath ExtensionsResult)
- getModuleAndCabalExtentions :: FilePath -> FilePath -> IO (Either ExtensionsError CabalAndModuleExtensions)
- getModuleExtentions :: FilePath -> FilePath -> IO ExtensionsResult
- getModuleAndCabalExtentionsBySource :: FilePath -> FilePath -> ByteString -> IO (Either ExtensionsError CabalAndModuleExtensions)
- getModuleExtentionsBySource :: FilePath -> FilePath -> ByteString -> IO ExtensionsResult

# Package modules

getPackageExtentions #

Arguments

:: FilePath | Path to `.cabal` file.
-> IO (Map FilePath ExtensionsResult) |

By given path to `.cabal` file, analyse extensions for each Haskell module and return the corresponding `Map` with `ExtensionsResult`s.

Throws:

- `CabalException`

getPackageExtentionsBySources #

Arguments

:: FilePath | Path to `.cabal` file.
-> Map FilePath ByteString | Path to modules with corresponding sources.
-> IO (Map FilePath ExtensionsResult) |

By given path to `.cabal` file and `Map` of sources of all Haskell modules, analyse extensions for each Haskell module and return the corresponding `Map` with `ExtensionsResult`s.

# Single module

getModuleAndCabalExtentions #

Arguments

:: FilePath | Path to `.cabal` file.
-> FilePath | Path to Haskell module file.
-> IO (Either ExtensionsError CabalAndModuleExtensions) |

By given path to `.cabal` file and path to Haskell module of the corresponding package, analyse and return extensions for the given module separately from .cabal file and from the module itself.

getModuleExtentions #

Arguments

:: FilePath | Path to `.cabal` file.
-> FilePath | Path to Haskell module file.
-> IO ExtensionsResult |

By given path to `.cabal` file and path to Haskell module of the corresponding package, analyse and return summary set of extensions for the given module.

getModuleAndCabalExtentionsBySource #

Arguments

:: FilePath | Maybe path to `.cabal` file.
-> FilePath | Path to the module's source (needed for matching with cabal file).
-> ByteString | Source of a Haskell module file.
-> IO (Either ExtensionsError CabalAndModuleExtensions) |

By given path to `.cabal` file and path to Haskell module of the corresponding package, analyse and return extensions extensions for the given module separately from .cabal file and from the module itself.

getModuleExtentionsBySource #

Arguments

:: FilePath | Maybe path to `.cabal` file.
-> FilePath | Path to the module's source (needed for matching with cabal file).
-> ByteString | Source of a Haskell module file.
-> IO ExtensionsResult |

By given path to `.cabal` file and path to Haskell module of the corresponding package, analyse and return combined set of extensions for the given module.