filepath-crypto/src/Data/Binary/SerializationLength/Class.hs
2025-07-14 16:00:07 +02:00

14 lines
455 B
Haskell

{-# LANGUAGE TypeFamilies #-}
module Data.Binary.SerializationLength.Class
( HasFixedSerializationLength(..)
) where
import GHC.TypeLits
-- | The class of types for which the result of serialization with @Data.Binary@
-- is known statically to be of a certain length
class KnownNat (SerializationLength a) => HasFixedSerializationLength a where
-- | The 'SerializationLength' is given in bytes at type level
type SerializationLength a :: Nat