{-# LANGUAGE UndecidableInstances #-}

module Binrep.Test where

import Binrep
import Binrep.Type.Magic
import Binrep.CBLen.Generic
import GHC.Generics ( Generic )

data DMagic = DMagic
  { DMagic -> Magic '[255, 0, 1, 0, 1, 0, 1, 255]
dMagic1_8b :: Magic '[0xFF, 0, 1, 0, 1, 0, 1, 0xFF]
  } deriving stock (forall x. DMagic -> Rep DMagic x)
-> (forall x. Rep DMagic x -> DMagic) -> Generic DMagic
forall x. Rep DMagic x -> DMagic
forall x. DMagic -> Rep DMagic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DMagic -> Rep DMagic x
from :: forall x. DMagic -> Rep DMagic x
$cto :: forall x. Rep DMagic x -> DMagic
to :: forall x. Rep DMagic x -> DMagic
Generic

instance IsCBLen DMagic where type CBLen DMagic = CBLenGeneric () DMagic
instance PutC DMagic where putC :: DMagic -> PutterC
putC = DMagic -> PutterC
forall a. (Generic a, GPoke PutC (Rep a)) => a -> PutterC
putGenericStruct