isobmff-0.14.0.0: A parser and generator for the ISO-14496-12/14 base media file format

Safe HaskellNone
LanguageHaskell2010

Data.Type.BitRecords.Structure.TypeLits

Synopsis

Documentation

type family PositiveInt (n :: Nat) where ... Source #

Equations

PositiveInt n = To (Signed Nat Nat) (Positive n :: Signed Nat Nat) 

type family NegativeInt (n :: Nat) where ... Source #

Equations

NegativeInt n = To (Signed Nat Nat) (Negative n :: Signed Nat Nat) 

type family Bits (xs :: [Nat]) where ... Source #

A literal bit sequence. The sequence is validated, only zeros and ones are allowed.

Equations

Bits xs = To (Sequence Bit Nat) xs 

class LiteralFamily a typeLitKind | a -> typeLitKind Source #

A kind class for kinds, that are inhabited on type-level by a certain kind of literal.

a
This parameter identifies the whole family; a type level literal kind of the family is determined by that parameter. No two instances for the same family but with different type level literal kinds are allowed.
typeLitKind
This is the kind of type level literals representing the static values inhabiting this family.

Associated Types

type InRange a (typeLit :: typeLitKind) :: Bool Source #

A predicate that is applied to a type-level-literal and is satisfied iff the given literal is in the range of valid type-level-literals of kind typeLitKind.

This is by SequenceLiteral for example.

type Pretty a (typeLit :: typeLitKind) :: PrettyType Source #

Convert a type level representation to a PrettyType

type PrettySeperator a (typeLit :: typeLitKind) :: PrettyType Source #

Seperator to use when rendering a list of literals of this family.

type SizeOf a (typeLit :: typeLitKind) :: Nat Source #

Return the number of bits that the literal value will occupy

Instances
LiteralFamily Bool Bool Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Bool typeLit :: Bool Source #

type Pretty Bool typeLit :: PrettyType Source #

type PrettySeperator Bool typeLit :: PrettyType Source #

type SizeOf Bool typeLit :: Nat Source #

LiteralFamily Word8 Nat Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Word8 typeLit :: Bool Source #

type Pretty Word8 typeLit :: PrettyType Source #

type PrettySeperator Word8 typeLit :: PrettyType Source #

type SizeOf Word8 typeLit :: Nat Source #

LiteralFamily Word16 Nat Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Word16 typeLit :: Bool Source #

type Pretty Word16 typeLit :: PrettyType Source #

type PrettySeperator Word16 typeLit :: PrettyType Source #

type SizeOf Word16 typeLit :: Nat Source #

LiteralFamily Nat Nat Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Nat typeLit :: Bool Source #

type Pretty Nat typeLit :: PrettyType Source #

type PrettySeperator Nat typeLit :: PrettyType Source #

type SizeOf Nat typeLit :: Nat Source #

LiteralFamily () () Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange () typeLit :: Bool Source #

type Pretty () typeLit :: PrettyType Source #

type PrettySeperator () typeLit :: PrettyType Source #

type SizeOf () typeLit :: Nat Source #

LiteralFamily Byte Nat Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Byte typeLit :: Bool Source #

type Pretty Byte typeLit :: PrettyType Source #

type PrettySeperator Byte typeLit :: PrettyType Source #

type SizeOf Byte typeLit :: Nat Source #

LiteralFamily Bit Nat Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Bit typeLit :: Bool Source #

type Pretty Bit typeLit :: PrettyType Source #

type PrettySeperator Bit typeLit :: PrettyType Source #

type SizeOf Bit typeLit :: Nat Source #

LiteralFamily Empty Empty Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Empty typeLit :: Bool Source #

type Pretty Empty typeLit :: PrettyType Source #

type PrettySeperator Empty typeLit :: PrettyType Source #

type SizeOf Empty typeLit :: Nat Source #

LiteralFamily s k => LiteralFamily (Maybe s :: Type) (Maybe k) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange (Maybe s) typeLit :: Bool Source #

type Pretty (Maybe s) typeLit :: PrettyType Source #

type PrettySeperator (Maybe s) typeLit :: PrettyType Source #

type SizeOf (Maybe s) typeLit :: Nat Source #

(LiteralFamily as ak, LiteralFamily bs bk) => LiteralFamily ((as, bs) :: Type) (ak, bk) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange (as, bs) typeLit :: Bool Source #

type Pretty (as, bs) typeLit :: PrettyType Source #

type PrettySeperator (as, bs) typeLit :: PrettyType Source #

type SizeOf (as, bs) typeLit :: Nat Source #

LiteralFamily t v => LiteralFamily (Signed t v :: Type) (Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange (Signed t v) typeLit :: Bool Source #

type Pretty (Signed t v) typeLit :: PrettyType Source #

type PrettySeperator (Signed t v) typeLit :: PrettyType Source #

type SizeOf (Signed t v) typeLit :: Nat Source #

LiteralFamily s k2 => LiteralFamily (Sequence s k2 :: Type) [k2] Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange (Sequence s k2) typeLit :: Bool Source #

type Pretty (Sequence s k2) typeLit :: PrettyType Source #

type PrettySeperator (Sequence s k2) typeLit :: PrettyType Source #

type SizeOf (Sequence s k2) typeLit :: Nat Source #

type family To s (x :: k) where ... Source #

Make a valid Value by checking the parameters using InRange and return a Value

Equations

To s (x :: k) = If (InRange s x) (Value s k x) (TypeError (((Text "Cannot make a " :<>: ShowType s) :<>: Text " from: ") :<>: ShowType x)) 

data Value s k (x :: k) :: Type Source #

The representation of a value belonging to a LiteralFamily

Instances
type PrettyStructure (LiteralStructure (Value s k1 x) :: Structure FixSize -> Type) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure

type PrettyStructure (LiteralStructure (Value s k1 x) :: Structure FixSize -> Type) = "LiteralStructure" <:> Pretty s x
type ToPretty (Value s k1 x :: Type) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type ToPretty (Value s k1 x :: Type) = Pretty s x
type GetStructureSize (LiteralStructure (Value s k1 x)) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure

data Empty Source #

An empty type literal

Instances
LiteralFamily Empty Empty Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Empty typeLit :: Bool Source #

type Pretty Empty typeLit :: PrettyType Source #

type PrettySeperator Empty typeLit :: PrettyType Source #

type SizeOf Empty typeLit :: Nat Source #

type ToPretty Empty Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type ToPretty Empty = PutStr "Empty"
type PrettySeperator Empty (typeLit :: Empty) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

data Bit Source #

A bit literal

Instances
LiteralFamily Bit Nat Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Bit typeLit :: Bool Source #

type Pretty Bit typeLit :: PrettyType Source #

type PrettySeperator Bit typeLit :: PrettyType Source #

type SizeOf Bit typeLit :: Nat Source #

type ToPretty Bit Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type ToPretty Bit = PutStr "Bit"
type InRange Bit (n :: Nat) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type InRange Bit (n :: Nat) = (n == 0) || (n == 1)
type Pretty Bit (n :: Nat) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type Pretty Bit (n :: Nat) = PutNat n
type PrettySeperator Bit (_ :: Nat) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type SizeOf Bit (_ :: Nat) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type SizeOf Bit (_ :: Nat) = 1

data Byte Source #

An unsigned byte literal

Instances
LiteralFamily Byte Nat Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange Byte typeLit :: Bool Source #

type Pretty Byte typeLit :: PrettyType Source #

type PrettySeperator Byte typeLit :: PrettyType Source #

type SizeOf Byte typeLit :: Nat Source #

type ToPretty Byte Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type ToPretty Byte = PutStr "Byte"
type InRange Byte (n :: Nat) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type InRange Byte (n :: Nat) = n <=? 255
type Pretty Byte (n :: Nat) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type Pretty Byte (n :: Nat) = PutHex n
type PrettySeperator Byte (typeLit :: Nat) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type PrettySeperator Byte (typeLit :: Nat) = PrettySpace
type SizeOf Byte (_ :: Nat) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type SizeOf Byte (_ :: Nat) = 8

data Signed t v Source #

A signed type literal for family t over GHC type literal v

Constructors

Positive v 
Negative v 
Instances
LiteralFamily t v => LiteralFamily (Signed t v :: Type) (Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange (Signed t v) typeLit :: Bool Source #

type Pretty (Signed t v) typeLit :: PrettyType Source #

type PrettySeperator (Signed t v) typeLit :: PrettyType Source #

type SizeOf (Signed t v) typeLit :: Nat Source #

type ToPretty (Signed t v :: Type) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type ToPretty (Signed t v :: Type) = ("Signed" <:> ToPretty t) <+> ToPretty v
type PrettySeperator (Signed t v :: Type) (typeLit :: Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type PrettySeperator (Signed t v :: Type) (typeLit :: Signed t v) = PrettySpace
type InRange (Signed t v :: Type) (Positive x :: Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type InRange (Signed t v :: Type) (Positive x :: Signed t v) = InRange t x
type InRange (Signed t v :: Type) (Negative x :: Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type InRange (Signed t v :: Type) (Negative x :: Signed t v) = InRange t x
type Pretty (Signed t v :: Type) (Positive x :: Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type Pretty (Signed t v :: Type) (Positive x :: Signed t v) = PutStr "+" <+> Pretty t x
type Pretty (Signed t v :: Type) (Negative x :: Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type Pretty (Signed t v :: Type) (Negative x :: Signed t v) = PutStr "-" <+> Pretty t x
type SizeOf (Signed t v :: Type) (Positive x :: Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type SizeOf (Signed t v :: Type) (Positive x :: Signed t v) = SizeOf t x + 1
type SizeOf (Signed t v :: Type) (Negative x :: Signed t v) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type SizeOf (Signed t v :: Type) (Negative x :: Signed t v) = SizeOf t x + 1
type ToPretty (Negative v :: Signed t k2) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type ToPretty (Negative v :: Signed t k2) = PutStr "-" <++> ToPretty v
type ToPretty (Positive v :: Signed t k2) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type ToPretty (Positive v :: Signed t k2) = PutStr "+" <++> ToPretty v

data Sequence s k Source #

A sequence of literals.

Instances
LiteralFamily s k2 => LiteralFamily (Sequence s k2 :: Type) [k2] Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

Associated Types

type InRange (Sequence s k2) typeLit :: Bool Source #

type Pretty (Sequence s k2) typeLit :: PrettyType Source #

type PrettySeperator (Sequence s k2) typeLit :: PrettyType Source #

type SizeOf (Sequence s k2) typeLit :: Nat Source #

type InRange (Sequence s k1 :: Type) (xs :: [k1]) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type InRange (Sequence s k1 :: Type) (xs :: [k1])
type Pretty (Sequence s k1 :: Type) (bs :: [k1]) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type Pretty (Sequence s k1 :: Type) (bs :: [k1])
type PrettySeperator (Sequence s k2 :: Type) ([] :: [k2]) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type PrettySeperator (Sequence s k2 :: Type) ([] :: [k2]) = PrettySpace
type SizeOf (Sequence s k2 :: Type) ([] :: [k2]) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type SizeOf (Sequence s k2 :: Type) ([] :: [k2]) = 0
type PrettySeperator (Sequence s k1 :: Type) (x ': xs :: [k1]) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type PrettySeperator (Sequence s k1 :: Type) (x ': xs :: [k1]) = PrettyNewline
type SizeOf (Sequence s k1 :: Type) (x ': xs :: [k1]) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type SizeOf (Sequence s k1 :: Type) (x ': xs :: [k1]) = SizeOf s x + SizeOf (Sequence s k1) xs
type ToPretty (Sequence t v :: Type) Source # 
Instance details

Defined in Data.Type.BitRecords.Structure.TypeLits

type ToPretty (Sequence t v :: Type) = "Sequence of" <:> ToPretty t