ormolu-0.7.4.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

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 #

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

parsePragma #

Arguments

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

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