multirec-binary-0.0.1: Generic Data.Binary instances using MultiRec.Source codeContentsIndex
Generics.MultiRec.Binary
Portabilitynon-portable
Stabilityexperimental
Maintainersfvisser@cs.uu.nl
Contents
Generic Data.Binary instances.
Description

Generic Data.Binary instances.

You can use these generic functions to create a Data.Binary instance. For example, for the Expr data type from the AST example from the MutliRec distribution:

 import Data.Binary
 import Generics.MultiRec.Base
 import Generics.MultiRec.Binary

 instance Binary Expr where
   put = gput AST
   get = gget AST
Synopsis
class HBinary phi f where
hput :: (forall ix'. phi ix' -> r ix' -> Put) -> phi ix -> f r ix -> Put
hget :: (forall ix'. El phi ix' => phi ix' -> Get (r ix')) -> phi ix -> Get (f r ix)
gput :: (Fam phi, HBinary phi (PF phi)) => phi ix -> ix -> Put
gget :: (Fam phi, HBinary phi (PF phi)) => phi ix -> Get ix
Generic Data.Binary instances.
class HBinary phi f whereSource
Methods
hput :: (forall ix'. phi ix' -> r ix' -> Put) -> phi ix -> f r ix -> PutSource
hget :: (forall ix'. El phi ix' => phi ix' -> Get (r ix')) -> phi ix -> Get (f r ix)Source
show/hide Instances
HBinary phi U
Binary a => HBinary phi (K a)
El phi xi => HBinary phi (I xi)
(Constructor c, HBinary phi f) => HBinary phi (C c f)
(EqS phi, El phi ix, HBinary phi f) => HBinary phi (f :>: ix)
(HBinary phi f, HBinary phi g) => HBinary phi (f :*: g)
(HBinary phi f, HBinary phi g) => HBinary phi (f :+: g)
gput :: (Fam phi, HBinary phi (PF phi)) => phi ix -> ix -> PutSource
Generic binary Put.
gget :: (Fam phi, HBinary phi (PF phi)) => phi ix -> Get ixSource
Generic binary Get.
Produced by Haddock version 2.4.2