Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provides the RawNumeric
class.
Since: 0.1
Synopsis
- class RawNumeric a where
Documentation
class RawNumeric a where Source #
Abstracts "wrapper" types for generically retrieving a raw numeric value.
Since: 0.1
Retrieves the underlying value.
Examples
>>>
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
RawNumeric (SomeSize n) Source # | Since: 0.1 | ||||
RawNumeric (SomeNet n) Source # | Since: 0.1 | ||||
RawNumeric (Bytes s n) Source # | Since: 0.1 | ||||
RawNumeric (SomeNetDir s n) Source # | Since: 0.1 | ||||
Defined in Data.Bytes.Network.Internal
toRaw :: SomeNetDir s n -> Raw (SomeNetDir s n) Source # | |||||
RawNumeric (SomeNetSize d n) Source # | Since: 0.1 | ||||
Defined in Data.Bytes.Network.Internal
toRaw :: SomeNetSize d n -> Raw (SomeNetSize d n) Source # | |||||
RawNumeric (NetBytes d s n) Source # | Since: 0.1 | ||||