cabal-install-parsers-0.3: Utilities to work with cabal-install files

LicenseGPL-3.0-or-later AND BSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Cabal.Parse

Description

.cabal and a like file parsing helpers.

Synopsis

Documentation

parseWith Source #

Arguments

:: ([Field Position] -> ParseResult a)

parse

-> FilePath

filename

-> ByteString

contents

-> Either (ParseError NonEmpty) a 

Parse the contents using provided parser from Field list.

This variant doesn't return any warnings in the successful case.

data ParseError f Source #

Parse error.

Instances
Show (f PError) => Show (ParseError f) Source # 
Instance details

Defined in Cabal.Parse

Generic (ParseError f) Source # 
Instance details

Defined in Cabal.Parse

Associated Types

type Rep (ParseError f) :: Type -> Type #

Methods

from :: ParseError f -> Rep (ParseError f) x #

to :: Rep (ParseError f) x -> ParseError f #

NFData (f PError) => NFData (ParseError f) Source #

Since: 0.2.1

Instance details

Defined in Cabal.Parse

Methods

rnf :: ParseError f -> () #

(Foldable f, Show (f PError), Typeable f) => Exception (ParseError f) Source # 
Instance details

Defined in Cabal.Parse

type Rep (ParseError f) Source # 
Instance details

Defined in Cabal.Parse

type Rep (ParseError f) = D1 (MetaData "ParseError" "Cabal.Parse" "cabal-install-parsers-0.3-5B8sGi9yrty8vUwhtChFwT" False) (C1 (MetaCons "ParseError" PrefixI True) ((S1 (MetaSel (Just "peFilename") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath) :*: S1 (MetaSel (Just "peContents") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)) :*: (S1 (MetaSel (Just "peErrors") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f PError)) :*: S1 (MetaSel (Just "peWarnings") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [PWarning]))))

renderParseError :: Foldable f => ParseError f -> String Source #

Render parse error highlighting the part of the input file.