web3-polkadot-1.0.1.0: Polkadot support for Haskell Web3 library.
CopyrightAleksandr Krupenkin 2016-2024
LicenseApache-2.0
Maintainermail@akru.me
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.Polkadot.Metadata.Type.Parser

Description

This module parse and cleanup raw types given from runtime, drop traits, generics, etc.

Synopsis

Documentation

fromText :: Text -> Either ParseError TypeAst Source #

Parse metadata type (general Rust type) from text.

fromTextM :: MonadFail m => Text -> m TypeAst Source #

This variant of fromText fails when error happens.

toText :: TypeAst -> Text Source #

Render Metadata type to text.

This function strongly sanitize type identifiers and paths, removes generics and other Rust related staff.

sanitize :: Text -> Either ParseError Text Source #

Cleanup type or return error when syntax failure.

sanitizeM :: MonadFail m => Text -> m Text Source #

Cleanup type or throw fail call when syntax failure.