filepath-crypto-0.0.0.0: src/Data/Binary/SerializationLength/TH.hs
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}
module Data.Binary.SerializationLength.TH
( hasFixedSerializationLength
) where
import Language.Haskell.TH
import Data.Binary.SerializationLength.Class
hasFixedSerializationLength :: Name -> Integer -> DecsQ
hasFixedSerializationLength (return . ConT -> t) (return . LitT . NumTyLit -> i) =
[d|
instance HasFixedSerializationLength $(t) where
type SerializationLength $(t) = $(i)
|]