Language.PureScript.CST.Utils

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.CST.Utils

Synopsis

- newtype QualifiedProperName = QualifiedProperName {
  - getQualifiedProperName :: forall (a :: ProperNameType). QualifiedName (ProperName a)
  }
- qualifiedProperName :: forall (a :: ProperNameType). QualifiedName (ProperName a) -> QualifiedProperName
- newtype ProperName = ProperName {
  - _getProperName :: forall (a :: ProperNameType). Name (ProperName a)
  }
- properName :: forall (a :: ProperNameType). Name (ProperName a) -> ProperName
- getProperName :: forall (a :: ProperNameType). ProperName -> Name (ProperName a)
- newtype QualifiedOpName = QualifiedOpName {
  - getQualifiedOpName :: forall (a :: OpNameType). QualifiedName (OpName a)
  }
- qualifiedOpName :: forall (a :: OpNameType). QualifiedName (OpName a) -> QualifiedOpName
- newtype OpName = OpName {
  - getOpName :: forall (a :: OpNameType). Name (OpName a)
  }
- opName :: forall (a :: OpNameType). 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 :: 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 :: ProperNameType). QualifiedName (ProperName a)

qualifiedProperName :: forall (a :: ProperNameType). 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 :: ProperNameType). Name (ProperName a)

properName :: forall (a :: ProperNameType). Name (ProperName a) -> ProperName #

getProperName :: forall (a :: ProperNameType). 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 :: OpNameType). QualifiedName (OpName a)

qualifiedOpName :: forall (a :: OpNameType). 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 :: OpNameType). Name (OpName a)

opName :: forall (a :: OpNameType). 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 :: 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