Copyright | Aleksandr Krupenkin 2016-2021 |
---|---|
License | Apache-2.0 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | noportable |
Safe Haskell | None |
Language | Haskell2010 |
This type helps to encode/decode singleton Rust enums like: `enum Enum { Data { some_data: u32 } }`
Synopsis
- newtype SingletonEnum a = SingletonEnum {
- unSingletonEnum :: a
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.
Instances
Decode a => Decode (SingletonEnum a) Source # | |
Defined in Codec.Scale.SingletonEnum get :: Get (SingletonEnum a) Source # | |
Encode a => Encode (SingletonEnum a) Source # | |
Defined in Codec.Scale.SingletonEnum put :: Putter (SingletonEnum a) Source # |