Skip to content

How does one specify a fixed length string? #176

@danwdart

Description

@danwdart

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions