purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.TypeChecker

Description

The top-level type checker, which checks all declarations in a module.

Synopsis

- module Language.PureScript.TypeChecker.Kinds
- module Language.PureScript.TypeChecker.Monad
- module Language.PureScript.TypeChecker.Roles
- module Language.PureScript.TypeChecker.Synonyms
- module Language.PureScript.TypeChecker.Types
- data Text
- typeCheckModule :: (MonadSupply m, MonadState CheckState m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Map ModuleName Exports -> Module -> m Module
- checkNewtype :: MonadError MultipleErrors m => ProperName 'TypeName -> [DataConstructorDeclaration] -> m (DataConstructorDeclaration, (Ident, SourceType))

# Documentation

module Language.PureScript.TypeChecker.Kinds

module Language.PureScript.TypeChecker.Monad

module Language.PureScript.TypeChecker.Roles

module Language.PureScript.TypeChecker.Synonyms

module Language.PureScript.TypeChecker.Types

data Text #

A space efficient, packed, unboxed Unicode text type.

#### Instances

Instances details

Structured Text |
Instance details Defined in Distribution.Utils.Structured Methods structure :: Proxy Text -> Structure # structureHash' :: Tagged Text MD5
FromJSON Text |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser Text # parseJSONList :: Value -> Parser [Text] # omittedField :: Maybe Text #
FromJSONKey Text |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction Text # fromJSONKeyList :: FromJSONKeyFunction [Text] #
ToJSON Text |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Text -> Value # toEncoding :: Text -> Encoding # toJSONList :: [Text] -> Value # toEncodingList :: [Text] -> Encoding # omitField :: Text -> Bool #
ToJSONKey Text |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction Text # toJSONKeyList :: ToJSONKeyFunction [Text] #
Chunk Text |

Instance details

Defined in Data.Attoparsec.Internal.Types

Associated Types

type ChunkElem Text |
Instance details Defined in Data.Attoparsec.Internal.Types type ChunkElem Text = Char

Methods

nullChunk :: Text -> Bool #

pappendChunk :: State Text -> Text -> State Text #

atBufferEnd :: Text -> State Text -> Pos #

bufferElemAt :: Text -> Pos -> State Text -> Maybe (ChunkElem Text, Int) #

chunkElemToChar :: Text -> ChunkElem Text -> Char #

ToMarkup Text |
Instance details Defined in Text.Blaze Methods toMarkup :: Text -> Markup # preEscapedToMarkup :: Text -> Markup #
ToValue Text |
Instance details Defined in Text.Blaze Methods toValue :: Text -> AttributeValue # preEscapedToValue :: Text -> AttributeValue #
ToLogStr Text |
Instance details Defined in System.Log.FastLogger.LogStr Methods toLogStr :: Text -> LogStr #
Hashable Text |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Text -> Int # hash :: Text -> Int #
Ixed Text |
Instance details Defined in Control.Lens.At Methods ix :: Index Text -> Traversal' Text (IxValue Text) #
AsEmpty Text |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' Text () #
Reversing Text |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: Text -> Text #
Prefixed Text |
Instance details Defined in Control.Lens.Prism Methods prefixed :: Text -> Prism' Text Text #
Suffixed Text |
Instance details Defined in Control.Lens.Prism Methods suffixed :: Text -> Prism' Text Text #
IsText Text |
Instance details Defined in Data.Text.Lens Methods packed :: Iso' String Text # builder :: Iso' Text Builder # text :: IndexedTraversal' Int Text Char #
Print Text |
Instance details Defined in Protolude.Show Methods hPutStr :: MonadIO m => Handle -> Text -> m () # putStr :: MonadIO m => Text -> m () # hPutStrLn :: MonadIO m => Handle -> Text -> m () # putStrLn :: MonadIO m => Text -> m () # putErrLn :: MonadIO m => Text -> m () #
Extract Text | Since: regex-base-0.94.0.0
Instance details Defined in Text.Regex.Base.RegexLike Methods before :: Int -> Text -> Text # after :: Int -> Text -> Text # empty :: Text # extract :: (Int, Int) -> Text -> Text #
Uncons Text | Since: regex-tdfa-1.3.1
Instance details Defined in Text.Regex.TDFA.NewDFA.Uncons Methods uncons :: Text -> Maybe (Char, Text) #
Serialise Text | Since: serialise-0.2.0.0
Instance details Defined in Codec.Serialise.Class Methods encode :: Text -> Encoding # decode :: Decoder s Text # encodeList :: [Text] -> Encoding # decodeList :: Decoder s [Text] #
StringConv ByteString Text |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> ByteString -> Text #
StringConv ByteString Text |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> ByteString -> Text #
StringConv Text ByteString |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> Text -> ByteString #
StringConv Text ByteString |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> Text -> ByteString #
StringConv Text Text |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> Text -> Text #
StringConv Text Text |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> Text -> Text #
StringConv Text String |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> Text -> String #
StringConv Text Text |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> Text -> Text #
StringConv String Text |
Instance details Defined in Protolude.Conv Methods strConv :: Leniency -> String -> Text #
ConvertText Text Text |
Instance details Defined in Protolude.ConvertText Methods toS :: Text -> Text #
ConvertText Text Text |
Instance details Defined in Protolude.ConvertText Methods toS :: Text -> Text #
ConvertText Text String |
Instance details Defined in Protolude.ConvertText Methods toS :: Text -> String #
ConvertText Text Text |
Instance details Defined in Protolude.ConvertText Methods toS :: Text -> Text #
ConvertText String Text |
Instance details Defined in Protolude.ConvertText Methods toS :: String -> Text #
Monad m => Stream Text m Char |
Instance details Defined in Text.Parsec.Prim Methods uncons :: Text -> m (Maybe (Char, Text)) #
Cons Text Text Char Char |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism Text Text (Char, Text) (Char, Text) #
Snoc Text Text Char Char |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism Text Text (Text, Char) (Text, Char) #

(a ~ Char, b ~ Char) => Each Text Text a b

    each :: Traversal Text Text Char Char

Instance details Defined in Control.Lens.Each Methods each :: Traversal Text Text a b #
type ChunkElem Text |
Instance details Defined in Data.Attoparsec.Internal.Types type ChunkElem Text = Char
type State Text |
Instance details Defined in Data.Attoparsec.Internal.Types type State Text = Buffer
type Item Text |
Instance details Defined in Data.Text type Item Text = Char
type Index Text |
Instance details Defined in Control.Lens.At type Index Text = Int
type IxValue Text |
Instance details Defined in Control.Lens.At type IxValue Text = Char

typeCheckModule :: (MonadSupply m, MonadState CheckState m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Map ModuleName Exports -> Module -> m Module #

Type check an entire module and ensure all types and classes defined within the module that are required by exported members are also exported.

checkNewtype :: MonadError MultipleErrors m => ProperName 'TypeName -> [DataConstructorDeclaration] -> m (DataConstructorDeclaration, (Ident, SourceType)) #

Check that a newtype has just one data constructor with just one field, or throw an error. If the newtype is valid, this function returns the single data constructor declaration and the single field, as a `proof` that the newtype was indeed a valid newtype.