futhark-0.25.15: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Futhark.Parser.Monad

Contents

Description

Utility functions and definitions used in the Happy-generated parser. They are defined here because the .y file is opaque to linters and other tools. In particular, we cannot enable warnings for that file, because Happy-generated code is very dirty by GHC's standards.

Synopsis

Documentation

data Comment Source #

A comment consists of its starting and end position, as well as its text. The contents include the comment start marker.

Constructors

Comment 

data SyntaxError Source #

A syntax error.

Constructors

SyntaxError 

backOneCol :: Loc -> Loc Source #

Move the end position back one column.

Reexports

data L a Source #

A value of type L a is a value of type a with an associated Loc, but this location is ignored when performing comparisons.

Instances

Instances details
Functor L 
Instance details

Defined in Data.Loc

Methods

fmap :: (a -> b) -> L a -> L b Source #

(<$) :: a -> L b -> L a Source #

Data a => Data (L a) 
Instance details

Defined in Data.Loc

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> L a -> c (L a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (L a) Source #

toConstr :: L a -> Constr Source #

dataTypeOf :: L a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (L a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (L a)) Source #

gmapT :: (forall b. Data b => b -> b) -> L a -> L a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> L a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> L a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> L a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> L a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> L a -> m (L a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> L a -> m (L a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> L a -> m (L a) Source #

Show x => Show (L x) 
Instance details

Defined in Data.Loc

Methods

showsPrec :: Int -> L x -> ShowS Source #

show :: L x -> String Source #

showList :: [L x] -> ShowS Source #

Eq x => Eq (L x) 
Instance details

Defined in Data.Loc

Methods

(==) :: L x -> L x -> Bool Source #

(/=) :: L x -> L x -> Bool Source #

Ord x => Ord (L x) 
Instance details

Defined in Data.Loc

Methods

compare :: L x -> L x -> Ordering Source #

(<) :: L x -> L x -> Bool Source #

(<=) :: L x -> L x -> Bool Source #

(>) :: L x -> L x -> Bool Source #

(>=) :: L x -> L x -> Bool Source #

max :: L x -> L x -> L x Source #

min :: L x -> L x -> L x Source #

Pretty x => Pretty (L x) 
Instance details

Defined in Text.PrettyPrint.Mainland.Class

Methods

ppr :: L x -> Doc Source #

pprPrec :: Int -> L x -> Doc Source #

pprList :: [L x] -> Doc Source #

Located (L a) 
Instance details

Defined in Data.Loc

Methods

locOf :: L a -> Loc Source #

locOfList :: [L a] -> Loc Source #

Relocatable (L a) 
Instance details

Defined in Data.Loc

Methods

reloc :: Loc -> L a -> L a Source #

data Token Source #

A lexical token. It does not itself contain position information, so in practice the parser will consume tokens tagged with a source position.

Instances

Instances details
Show Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens

Eq Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens

Methods

(==) :: Token -> Token -> Bool Source #

(/=) :: Token -> Token -> Bool Source #

Ord Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens