si-bytes-0.1: Byte with type-level units (e.g. B, KB, MB, ...).
Safe HaskellNone
LanguageHaskell2010

Data.Bytes.Class.RawNumeric

Description

Provides the RawNumeric class.

Since: 0.1

Synopsis

Documentation

class RawNumeric a where Source #

Abstracts "wrapper" types for generically retrieving a raw numeric value.

Since: 0.1

Associated Types

type Raw a Source #

Since: 0.1

Methods

toRaw :: a -> Raw a Source #

Retrieves the underlying value.

Examples

Expand
>>> import Data.Bytes (Bytes (..), Size (..), Sized (..))
>>> toRaw (MkBytes @G 7)
7
>>> toRaw (hideSize $ MkBytes @M 400)
400
>>> import Data.Bytes.Network (Direction (..), NetBytes (..))
>>> toRaw (MkNetBytesP @Up @G 7)
7
>>> toRaw (hideSize $ MkNetBytesP @Up @G 7)
7

Since: 0.1

Instances

Instances details
RawNumeric (SomeSize n) Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Internal

Associated Types

type Raw (SomeSize n) 
Instance details

Defined in Data.Bytes.Internal

type Raw (SomeSize n) = n

Methods

toRaw :: SomeSize n -> Raw (SomeSize n) Source #

RawNumeric (SomeNet n) Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Network.Internal

Associated Types

type Raw (SomeNet n) 
Instance details

Defined in Data.Bytes.Network.Internal

type Raw (SomeNet n) = n

Methods

toRaw :: SomeNet n -> Raw (SomeNet n) Source #

RawNumeric (Bytes s n) Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Internal

Associated Types

type Raw (Bytes s n) 
Instance details

Defined in Data.Bytes.Internal

type Raw (Bytes s n) = n

Methods

toRaw :: Bytes s n -> Raw (Bytes s n) Source #

RawNumeric (SomeNetDir s n) Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Network.Internal

Associated Types

type Raw (SomeNetDir s n) 
Instance details

Defined in Data.Bytes.Network.Internal

type Raw (SomeNetDir s n) = n

Methods

toRaw :: SomeNetDir s n -> Raw (SomeNetDir s n) Source #

RawNumeric (SomeNetSize d n) Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Network.Internal

Associated Types

type Raw (SomeNetSize d n) 
Instance details

Defined in Data.Bytes.Network.Internal

type Raw (SomeNetSize d n) = n

Methods

toRaw :: SomeNetSize d n -> Raw (SomeNetSize d n) Source #

RawNumeric (NetBytes d s n) Source #

Since: 0.1

Instance details

Defined in Data.Bytes.Network.Internal

Associated Types

type Raw (NetBytes d s n) 
Instance details

Defined in Data.Bytes.Network.Internal

type Raw (NetBytes d s n) = n

Methods

toRaw :: NetBytes d s n -> Raw (NetBytes d s n) Source #