scale-1.0.0.0: SCALE v2.0 codec for Haskell Web3 library.
CopyrightAleksandr Krupenkin 2016-2021
LicenseApache-2.0
Maintainermail@akru.me
Stabilityexperimental
Portabilitynoportable
Safe HaskellNone
LanguageHaskell2010

Codec.Scale.SingletonEnum

Description

This type helps to encode/decode singleton Rust enums like: `enum Enum { Data { some_data: u32 } }`

Synopsis

Documentation

newtype SingletonEnum a Source #

Haskell don't permit to make Rust-like enum type with only one element. For this reason it is impossible to make generic parser for singleton enum type. This type helps to parse Rust encoded singleton enums.

Constructors

SingletonEnum 

Fields

Instances

Instances details
Decode a => Decode (SingletonEnum a) Source # 
Instance details

Defined in Codec.Scale.SingletonEnum

Methods

get :: Get (SingletonEnum a) Source #

Encode a => Encode (SingletonEnum a) Source # 
Instance details

Defined in Codec.Scale.SingletonEnum