describe-0.4.0.4: Combinators for describing binary data structures

Safe HaskellNone
LanguageHaskell2010

Data.Serialize.Describe.Combinators.ByteEnum

Description

ByteEnum wraps an Enum to be described as a Word8. Intended to be used with DerivingVia so as to not introduce unnecessary newtype wrappers:

data MyEnum = A | B | C 
            deriving Enum
            deriving Describe via ByteEnum MyEnum

Documentation

newtype ByteEnum e Source #

Constructors

ByteEnum 

Fields

Instances
Generic (ByteEnum e) Source # 
Instance details

Defined in Data.Serialize.Describe.Combinators.ByteEnum

Associated Types

type Rep (ByteEnum e) :: Type -> Type #

Methods

from :: ByteEnum e -> Rep (ByteEnum e) x #

to :: Rep (ByteEnum e) x -> ByteEnum e #

Wrapped (ByteEnum e) Source # 
Instance details

Defined in Data.Serialize.Describe.Combinators.ByteEnum

Associated Types

type Unwrapped (ByteEnum e) :: Type

Methods

_Wrapped' :: Iso' (ByteEnum e) (Unwrapped (ByteEnum e))

Enum e => Describe (ByteEnum e) Source # 
Instance details

Defined in Data.Serialize.Describe.Combinators.ByteEnum

Associated Types

type Context m (ByteEnum e) :: Constraint Source #

Methods

describe :: (MonadTrans m, forall (x :: Type -> Type). Monad x => Monad (m x), Context m (ByteEnum e)) => DescriptorM m (ByteEnum e) (ByteEnum e) Source #

type Context m (ByteEnum e) Source # 
Instance details

Defined in Data.Serialize.Describe.Combinators.ByteEnum

type Context m (ByteEnum e) = ()
type Rep (ByteEnum e) Source # 
Instance details

Defined in Data.Serialize.Describe.Combinators.ByteEnum

type Rep (ByteEnum e) = D1 (MetaData "ByteEnum" "Data.Serialize.Describe.Combinators.ByteEnum" "describe-0.4.0.4-inplace" True) (C1 (MetaCons "ByteEnum" PrefixI True) (S1 (MetaSel (Just "unwrapByteEnum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 e)))
type Unwrapped (ByteEnum e) Source # 
Instance details

Defined in Data.Serialize.Describe.Combinators.ByteEnum

type Unwrapped (ByteEnum e) = GUnwrapped (Rep (ByteEnum e))