ormolu-0.5.3.0: A formatter for Haskell source code

Safe Haskell | Safe-Inferred
Language | Haskell2010

Ormolu.Parser.Pragma

Description

A module for parsing of pragmas from comments.

Synopsis

- data Pragma
  - = PragmaLanguage [Text]
  - | PragmaOptionsGHC Text
  - | PragmaOptionsHaddock Text
- parsePragma :: Text -> Maybe Pragma

# Documentation

data Pragma Source #

Ormolu's representation of pragmas.

Constructors

PragmaLanguage [Text] | Language pragma
PragmaOptionsGHC Text | GHC options pragma
PragmaOptionsHaddock Text | Haddock options pragma

#### Instances

Instances details

Show Pragma Source # |
Instance details Defined in Ormolu.Parser.Pragma Methods showsPrec :: Int -> Pragma -> ShowS Source # show :: Pragma -> String Source # showList :: [Pragma] -> ShowS Source #
Eq Pragma Source # |
Instance details Defined in Ormolu.Parser.Pragma Methods (==) :: Pragma -> Pragma -> Bool Source # (/=) :: Pragma -> Pragma -> Bool Source #

parsePragma Source #

Arguments

:: Text | Comment to try to parse
-> Maybe Pragma |

Extract a pragma from a comment if possible, or return `Nothing` otherwise.