Skip to content

support generics #9

Description

@teto

It would be cool if we could have Ghc.Generics support to allow the generation of Convertable's getGet/getPut. It can be very tedious to write this code otherwise.

something like

class Convertable a where
  getGet :: MessageType -> Get a -- ^get a 'Get' function for the static data
  getPut :: a -> Put -- ^get a 'Put' function for the static data

  -- inspired by 
  default getGet :: (Generic a) => MessageType -> Get a
  getGet = genericGetGet

  default getGet :: (Generic a) => MessageType -> Put
  getGet = genericGetPut

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions