purescript-0.15.12: PureScript Programming Language Compiler

Safe Haskell | Safe-Inferred
Language | Haskell2010

Language.PureScript.CST.Utils

Synopsis

- newtype QualifiedProperName = QualifiedProperName {
  - getQualifiedProperName :: forall a. QualifiedName (ProperName a)
  }
- qualifiedProperName :: QualifiedName (ProperName a) -> QualifiedProperName
- newtype ProperName = ProperName {
  - _getProperName :: forall a. Name (ProperName a)
  }
- properName :: Name (ProperName a) -> ProperName
- getProperName :: forall a. ProperName -> Name (ProperName a)
- newtype QualifiedOpName = QualifiedOpName {
  - getQualifiedOpName :: forall a. QualifiedName (OpName a)
  }
- qualifiedOpName :: QualifiedName (OpName a) -> QualifiedOpName
- newtype OpName = OpName {
  - getOpName :: forall a. Name (OpName a)
  }
- opName :: Name (OpName a) -> OpName
- placeholder :: SourceToken
- unexpectedName :: SourceToken -> Name Ident
- unexpectedQual :: SourceToken -> QualifiedName Ident
- unexpectedLabel :: SourceToken -> Label
- unexpectedExpr :: Monoid a => [SourceToken] -> Expr a
- unexpectedBinder :: Monoid a => [SourceToken] -> Binder a
- unexpectedRecordUpdate :: Monoid a => [SourceToken] -> RecordUpdate a
- unexpectedRecordLabeled :: [SourceToken] -> RecordLabeled a
- rangeToks :: TokenRange -> [SourceToken]
- unexpectedToks :: (a -> TokenRange) -> ([SourceToken] -> b) -> ParserErrorType -> a -> Parser b
- separated :: [(SourceToken, a)] -> Separated a
- internalError :: String -> a
- toModuleName :: SourceToken -> [Text] -> Parser (Maybe ModuleName)
- upperToModuleName :: SourceToken -> Parser (Name ModuleName)
- toQualifiedName :: (Text -> a) -> SourceToken -> Parser (QualifiedName a)
- toName :: (Text -> a) -> SourceToken -> Parser (Name a)
- toLabel :: SourceToken -> Label
- toString :: SourceToken -> (SourceToken, PSString)
- toChar :: SourceToken -> (SourceToken, Char)
- toNumber :: SourceToken -> (SourceToken, Either Integer Double)
- toInt :: SourceToken -> (SourceToken, Integer)
- toBoolean :: SourceToken -> (SourceToken, Bool)
- toConstraint :: forall a. Monoid a => Type a -> Parser (Constraint a)
- isConstrained :: Type a -> Bool
- toBinderConstructor :: Monoid a => NonEmpty (Binder a) -> Parser (Binder a)
- toRecordFields :: Monoid a => Separated (Either (RecordLabeled (Expr a)) (RecordUpdate a)) -> Parser (Either (Separated (RecordLabeled (Expr a))) (Separated (RecordUpdate a)))
- checkFundeps :: ClassHead a -> Parser ()
- data TmpModuleDecl a
  - = TmpImport (ImportDecl a)
  - | TmpChain (Separated (Declaration a))
- toModuleDecls :: Monoid a => [TmpModuleDecl a] -> Parser ([ImportDecl a], [Declaration a])
- checkNoWildcards :: Type a -> Parser ()
- checkNoForalls :: Type a -> Parser ()
- revert :: Parser a -> SourceToken -> Parser a
- reservedNames :: Set Text
- isValidModuleNamespace :: Text -> Bool
- isLeftFatArrow :: Text -> Bool

# Documentation

newtype QualifiedProperName #

A newtype for a qualified proper name whose ProperNameType has not yet been determined. This is a workaround for Happy's limited support for polymorphism; it is used inside the parser to allow us to write just one parser for qualified proper names which can be used for all of the different ProperNameTypes (via a call to getQualifiedProperName).

Constructors

QualifiedProperName |
Fields getQualifiedProperName :: forall a. QualifiedName (ProperName a)

qualifiedProperName :: QualifiedName (ProperName a) -> QualifiedProperName #

newtype ProperName #

A newtype for a proper name whose ProperNameType has not yet been determined. This is a workaround for Happy's limited support for polymorphism; it is used inside the parser to allow us to write just one parser for proper names which can be used for all of the different ProperNameTypes (via a call to getProperName).

Constructors

ProperName |
Fields _getProperName :: forall a. Name (ProperName a)

properName :: Name (ProperName a) -> ProperName #

getProperName :: forall a. ProperName -> Name (ProperName a) #

newtype QualifiedOpName #

A newtype for a qualified operator name whose OpNameType has not yet been determined. This is a workaround for Happy's limited support for polymorphism; it is used inside the parser to allow us to write just one parser for qualified operator names which can be used for all of the different OpNameTypes (via a call to getQualifiedOpName).

Constructors

QualifiedOpName |
Fields getQualifiedOpName :: forall a. QualifiedName (OpName a)

qualifiedOpName :: QualifiedName (OpName a) -> QualifiedOpName #

newtype OpName #

A newtype for a operator name whose OpNameType has not yet been determined. This is a workaround for Happy's limited support for polymorphism; it is used inside the parser to allow us to write just one parser for operator names which can be used for all of the different OpNameTypes (via a call to getOpName).

Constructors

OpName |
Fields getOpName :: forall a. Name (OpName a)

opName :: Name (OpName a) -> OpName #

placeholder :: SourceToken #

unexpectedName :: SourceToken -> Name Ident #

unexpectedQual :: SourceToken -> QualifiedName Ident #

unexpectedLabel :: SourceToken -> Label #

unexpectedExpr :: Monoid a => [SourceToken] -> Expr a #

unexpectedBinder :: Monoid a => [SourceToken] -> Binder a #

unexpectedRecordUpdate :: Monoid a => [SourceToken] -> RecordUpdate a #

unexpectedRecordLabeled :: [SourceToken] -> RecordLabeled a #

rangeToks :: TokenRange -> [SourceToken] #

unexpectedToks :: (a -> TokenRange) -> ([SourceToken] -> b) -> ParserErrorType -> a -> Parser b #

separated :: [(SourceToken, a)] -> Separated a #

internalError :: String -> a #

toModuleName :: SourceToken -> [Text] -> Parser (Maybe ModuleName) #

upperToModuleName :: SourceToken -> Parser (Name ModuleName) #

toQualifiedName :: (Text -> a) -> SourceToken -> Parser (QualifiedName a) #

toName :: (Text -> a) -> SourceToken -> Parser (Name a) #

toLabel :: SourceToken -> Label #

toString :: SourceToken -> (SourceToken, PSString) #

toChar :: SourceToken -> (SourceToken, Char) #

toNumber :: SourceToken -> (SourceToken, Either Integer Double) #

toInt :: SourceToken -> (SourceToken, Integer) #

toBoolean :: SourceToken -> (SourceToken, Bool) #

toConstraint :: forall a. Monoid a => Type a -> Parser (Constraint a) #

isConstrained :: Type a -> Bool #

toBinderConstructor :: Monoid a => NonEmpty (Binder a) -> Parser (Binder a) #

toRecordFields :: Monoid a => Separated (Either (RecordLabeled (Expr a)) (RecordUpdate a)) -> Parser (Either (Separated (RecordLabeled (Expr a))) (Separated (RecordUpdate a))) #

checkFundeps :: ClassHead a -> Parser () #

data TmpModuleDecl a #

Constructors

TmpImport (ImportDecl a) |
TmpChain (Separated (Declaration a)) |

#### Instances

Instances details

Show a => Show (TmpModuleDecl a) # |
Instance details Defined in Language.PureScript.CST.Utils Methods showsPrec :: Int -> TmpModuleDecl a -> ShowS # show :: TmpModuleDecl a -> String # showList :: [TmpModuleDecl a] -> ShowS #

toModuleDecls :: Monoid a => [TmpModuleDecl a] -> Parser ([ImportDecl a], [Declaration a]) #

checkNoWildcards :: Type a -> Parser () #

checkNoForalls :: Type a -> Parser () #

revert :: Parser a -> SourceToken -> Parser a #

reservedNames :: Set Text #

isValidModuleNamespace :: Text -> Bool #

isLeftFatArrow :: Text -> Bool #

This is to keep the `Parser.y` file ASCII, otherwise `happy` will break in non-unicode locales.

Related GHC issue: https://gitlab.haskell.org/ghc/ghc/issues/8167