hindent-6.0.0: Extensible Haskell pretty printer
Safe HaskellSafe-Inferred
LanguageHaskell2010

HIndent.LanguageExtension.Conversion

Description

Operations for converting extensions types.

Synopsis

Documentation

fromCabalExtension :: Extension -> Maybe Extension Source #

Converts from an Extension defined in the Cabal package to an Extension defined in HIndent.

Note that this function returns Nothing if UnknownExtension is passed or if an extension is not supported by GHC.

uniqueExtensions :: [Extension] -> [Extension] Source #

This function converts each value of the type Extension defined in Types in the list to the same value of the type Extension defined in the package 'ghc-lib-parser'.

If the extension has the No suffix, the extension is removed from the result. If both extensions having and not having the suffix exist in the list, only the most backward one has the effect.

If converting an extension fails due to neither GHC nor 'ghc-lib-parser' not supporting, or deprecation or removal, the extension is ignored.

convertExtension :: KnownExtension -> Maybe Extension Source #

This function converts a value of KnownExtension defined in the Cabal package to the same value of Extension defined in 'ghc-lib-parser'.

This function returns a Just value if it succeeds in converting. Otherwise (e.g., 'ghc-lib-parser' does not the passed extension, or it is deprecated or removed), it returns a Nothing.

strToExt :: String -> Maybe Extension Source #

Converts the given string to an extension, or returns a Nothing on fail.