binary icon indicating copy to clipboard operation
binary copied to clipboard

How does one specify a fixed length string?

Open danwdart opened this issue 5 years ago • 0 comments
trafficstars

I was starting with:

data Variable = Variable {
    length :: !Word32,
    var :: !ByteString,
    tree :: !Word8
} deriving (Generic, Binary, Show)

but I need the var to be a static length of course. What's the recommended way to do this? Arrays? DataKinds types? Smart constructors on custom types?

Ta

danwdart avatar Sep 16 '20 12:09 danwdart