Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
type family Weak (a :: Type) :: Type Source #
Obtain the weak representation of the given type.
Instances
type Weak Int16 Source # | |
Defined in Strongweak.SW | |
type Weak Int32 Source # | |
Defined in Strongweak.SW | |
type Weak Int64 Source # | |
Defined in Strongweak.SW | |
type Weak Int8 Source # | |
Defined in Strongweak.SW | |
type Weak Word16 Source # | |
Defined in Strongweak.SW | |
type Weak Word32 Source # | |
Defined in Strongweak.SW | |
type Weak Word64 Source # | |
Defined in Strongweak.SW | |
type Weak Word8 Source # | |
Defined in Strongweak.SW | |
type Weak (Refined p a) Source # | |
Defined in Strongweak.SW | |
type Weak (Vector n a) Source # | |
Defined in Strongweak.SW |
type family SW (s :: Strength) a :: Type where ... Source #
Obtain either the strong or weak representation of a type, depending on the type-level strength "switch" provided.
This is intended to be used in data types that take a Strength
type. Define
your type using strong fields wrapped in Switch s
. You then get the weak
representation for free, using the same definition.
data A (s :: Strength) = A { aField1 :: Switch s Word8 , aField2 :: String }