miso
Copyright(C) 2016-2025 David M. Johnson (@dmjio)
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Util.Lexer

Description

 
Synopsis

Types

newtype Lexer token Source #

Constructors

Lexer 

Fields

Instances

Instances details
Alternative Lexer Source # 
Instance details

Defined in Miso.Util.Lexer

Methods

empty :: Lexer a #

(<|>) :: Lexer a -> Lexer a -> Lexer a #

some :: Lexer a -> Lexer [a] #

many :: Lexer a -> Lexer [a] #

Applicative Lexer Source # 
Instance details

Defined in Miso.Util.Lexer

Methods

pure :: a -> Lexer a #

(<*>) :: Lexer (a -> b) -> Lexer a -> Lexer b #

liftA2 :: (a -> b -> c) -> Lexer a -> Lexer b -> Lexer c #

(*>) :: Lexer a -> Lexer b -> Lexer b #

(<*) :: Lexer a -> Lexer b -> Lexer a #

Functor Lexer Source # 
Instance details

Defined in Miso.Util.Lexer

Methods

fmap :: (a -> b) -> Lexer a -> Lexer b #

(<$) :: a -> Lexer b -> Lexer a #

Monad Lexer Source # 
Instance details

Defined in Miso.Util.Lexer

Methods

(>>=) :: Lexer a -> (a -> Lexer b) -> Lexer b #

(>>) :: Lexer a -> Lexer b -> Lexer b #

return :: a -> Lexer a #

data Location Source #

Constructors

Location 

Fields

Instances

Instances details
Show Location Source # 
Instance details

Defined in Miso.Util.Lexer

Eq Location Source # 
Instance details

Defined in Miso.Util.Lexer

data Located token Source #

Constructors

Located 

Fields

Instances

Instances details
Show token => Show (Located token) Source # 
Instance details

Defined in Miso.Util.Lexer

Methods

showsPrec :: Int -> Located token -> ShowS #

show :: Located token -> String #

showList :: [Located token] -> ShowS #

Eq token => Eq (Located token) Source # 
Instance details

Defined in Miso.Util.Lexer

Methods

(==) :: Located token -> Located token -> Bool #

(/=) :: Located token -> Located token -> Bool #

data LexerError Source #

Instances

Instances details
Show LexerError Source # 
Instance details

Defined in Miso.Util.Lexer

Eq LexerError Source # 
Instance details

Defined in Miso.Util.Lexer

data Stream Source #

Constructors

Stream 

Instances

Instances details
Eq Stream Source # 
Instance details

Defined in Miso.Util.Lexer

Methods

(==) :: Stream -> Stream -> Bool #

(/=) :: Stream -> Stream -> Bool #

Combinators

oops :: Lexer token Source #

withLocation :: ToMisoString token => Lexer token -> Lexer (Located token) Source #