structured-0.1: Tagged serialisation.

Safe HaskellTrustworthy
LanguageHaskell2010

Data.Structured.Internal

Synopsis

Documentation

type TypeVersion = Word32 Source #

A sematic version of a data type. Usually 0.

data Structure Source #

Structure of a datatype.

It can be infinite, as far as TypeReps involved are finite. (e.g. polymorphic recursion might cause troubles).

Constructors

Nominal !TypeRep !TypeVersion TypeName [Structure]

nominal, yet can be parametrised by other structures.

Newtype !TypeRep !TypeVersion TypeName Structure

a newtype wrapper

Structure !TypeRep !TypeVersion TypeName SopStructure

sum-of-products structure

Instances
Eq Structure Source # 
Instance details

Defined in Data.Structured.Internal

Ord Structure Source # 
Instance details

Defined in Data.Structured.Internal

Show Structure Source # 
Instance details

Defined in Data.Structured.Internal

Generic Structure Source # 
Instance details

Defined in Data.Structured.Internal

Associated Types

type Rep Structure :: Type -> Type #

type Rep Structure Source # 
Instance details

Defined in Data.Structured.Internal

type Rep Structure = D1 (MetaData "Structure" "Data.Structured.Internal" "structured-0.1-7OlXsBuGaoOHMb8ojbhIJr" False) (C1 (MetaCons "Nominal" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TypeRep) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TypeVersion)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TypeName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Structure]))) :+: (C1 (MetaCons "Newtype" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TypeRep) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TypeVersion)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TypeName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Structure))) :+: C1 (MetaCons "Structure" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TypeRep) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TypeVersion)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TypeName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SopStructure)))))

hashStructure :: Structure -> MD5 Source #

A MD5 hash digest of Structure.

typeName :: Functor f => (TypeName -> f TypeName) -> Structure -> f Structure Source #

A van-Laarhoven lens into TypeName of Structure

typeName :: Lens' Structure TypeName

structureBuilder :: Structure -> Builder Source #

Flatten Structure into something we can calculate hash of.

As Structure can be potentially infinite. For mutually recursive types, we keep track of TypeReps, and put just TypeRep name when it's occurred another time.

class Typeable a => Structured a where Source #

Class of types with a known Structure.

For regular data types Structured can be derived generically.

data Record = Record { a :: Int, b :: Bool, c :: [Char] } deriving (Generic)
instance Structured Record

Since: 3.2.0.0

Minimal complete definition

Nothing

Instances
Structured Bool Source # 
Instance details

Defined in Data.Structured.Internal

Structured Char Source # 
Instance details

Defined in Data.Structured.Internal

Structured Double Source # 
Instance details

Defined in Data.Structured.Internal

Structured Float Source # 
Instance details

Defined in Data.Structured.Internal

Structured Int Source # 
Instance details

Defined in Data.Structured.Internal

Structured Int8 Source # 
Instance details

Defined in Data.Structured.Internal

Structured Int16 Source # 
Instance details

Defined in Data.Structured.Internal

Structured Int32 Source # 
Instance details

Defined in Data.Structured.Internal

Structured Int64 Source # 
Instance details

Defined in Data.Structured.Internal

Structured Integer Source # 
Instance details

Defined in Data.Structured.Internal

Structured Natural Source # 
Instance details

Defined in Data.Structured.Internal

Structured Ordering Source # 
Instance details

Defined in Data.Structured.Internal

Structured Word Source # 
Instance details

Defined in Data.Structured.Internal

Structured Word8 Source # 
Instance details

Defined in Data.Structured.Internal

Structured Word16 Source # 
Instance details

Defined in Data.Structured.Internal

Structured Word32 Source # 
Instance details

Defined in Data.Structured.Internal

Structured Word64 Source # 
Instance details

Defined in Data.Structured.Internal

Structured () Source # 
Instance details

Defined in Data.Structured.Internal

Structured ByteString Source # 
Instance details

Defined in Data.Structured.Internal

Structured ByteString Source # 
Instance details

Defined in Data.Structured.Internal

Structured Scientific Source # 
Instance details

Defined in Data.Structured.Internal

Structured Text Source # 
Instance details

Defined in Data.Structured.Internal

Structured UTCTime Source # 
Instance details

Defined in Data.Structured.Internal

Structured Value Source # 
Instance details

Defined in Data.Structured.Internal

Structured Text Source # 
Instance details

Defined in Data.Structured.Internal

Structured Version Source # 
Instance details

Defined in Data.Structured.Internal

Structured All Source # 
Instance details

Defined in Data.Structured.Internal

Structured Any Source # 
Instance details

Defined in Data.Structured.Internal

Structured ShortByteString Source # 
Instance details

Defined in Data.Structured.Internal

Structured IntSet Source # 
Instance details

Defined in Data.Structured.Internal

Structured LocalTime Source # 
Instance details

Defined in Data.Structured.Internal

Structured TimeOfDay Source # 
Instance details

Defined in Data.Structured.Internal

Structured TimeZone Source # 
Instance details

Defined in Data.Structured.Internal

Structured UniversalTime Source # 
Instance details

Defined in Data.Structured.Internal

Structured NominalDiffTime Source # 
Instance details

Defined in Data.Structured.Internal

Structured DiffTime Source # 
Instance details

Defined in Data.Structured.Internal

Structured Day Source # 
Instance details

Defined in Data.Structured.Internal

Structured DayOfWeek Source # 
Instance details

Defined in Data.Structured.Internal

Structured UUID Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured [a] Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Maybe a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Ratio a) Source # 
Instance details

Defined in Data.Structured.Internal

(Typeable a, HasResolution a) => Structured (Fixed a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Min a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Max a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (First a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Last a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (WrappedMonoid a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (First a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Last a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Dual a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Endo a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Sum a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (Product a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured a => Structured (NonEmpty a) Source # 
Instance details

Defined in Data.Structured.Internal

Structured v => Structured (IntMap v) Source # 
Instance details

Defined in Data.Structured.Internal

Structured v => Structured (Seq v) Source # 
Instance details

Defined in Data.Structured.Internal

Structured k => Structured (Set k) Source # 
Instance details

Defined in Data.Structured.Internal

Structured k => Structured (HashSet k) Source # 
Instance details

Defined in Data.Structured.Internal

Structured v => Structured (Vector v) Source # 
Instance details

Defined in Data.Structured.Internal

Structured v => Structured (Vector v) Source # 
Instance details

Defined in Data.Structured.Internal

Structured v => Structured (Vector v) Source # 
Instance details

Defined in Data.Structured.Internal

(Structured a, Structured b) => Structured (a -> b) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

structure :: Proxy (a -> b) -> Structure Source #

structureHash' :: Tagged (a -> b) MD5 Source #

(Structured a, Structured b) => Structured (Either a b) Source # 
Instance details

Defined in Data.Structured.Internal

(Structured a1, Structured a2) => Structured (a1, a2) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

structure :: Proxy (a1, a2) -> Structure Source #

structureHash' :: Tagged (a1, a2) MD5 Source #

(Structured k, Structured v) => Structured (HashMap k v) Source # 
Instance details

Defined in Data.Structured.Internal

(Structured k, Structured v) => Structured (Map k v) Source # 
Instance details

Defined in Data.Structured.Internal

(Structured i, Structured e) => Structured (UArray i e) Source # 
Instance details

Defined in Data.Structured.Internal

(Structured i, Structured e) => Structured (Array i e) Source # 
Instance details

Defined in Data.Structured.Internal

(Structured a1, Structured a2, Structured a3) => Structured (a1, a2, a3) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

structure :: Proxy (a1, a2, a3) -> Structure Source #

structureHash' :: Tagged (a1, a2, a3) MD5 Source #

(Typeable k, Typeable b, Structured a) => Structured (Tagged b a) Source # 
Instance details

Defined in Data.Structured.Internal

(Structured a1, Structured a2, Structured a3, Structured a4) => Structured (a1, a2, a3, a4) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

structure :: Proxy (a1, a2, a3, a4) -> Structure Source #

structureHash' :: Tagged (a1, a2, a3, a4) MD5 Source #

(Structured a1, Structured a2, Structured a3, Structured a4, Structured a5) => Structured (a1, a2, a3, a4, a5) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

structure :: Proxy (a1, a2, a3, a4, a5) -> Structure Source #

structureHash' :: Tagged (a1, a2, a3, a4, a5) MD5 Source #

(Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6) => Structured (a1, a2, a3, a4, a5, a6) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

structure :: Proxy (a1, a2, a3, a4, a5, a6) -> Structure Source #

structureHash' :: Tagged (a1, a2, a3, a4, a5, a6) MD5 Source #

(Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6, Structured a7) => Structured (a1, a2, a3, a4, a5, a6, a7) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

structure :: Proxy (a1, a2, a3, a4, a5, a6, a7) -> Structure Source #

structureHash' :: Tagged (a1, a2, a3, a4, a5, a6, a7) MD5 Source #

structureHash :: forall a. Structured a => Proxy a -> MD5 Source #

Semantically hashStructure . structure.

nominalStructure :: Typeable a => Proxy a -> Structure Source #

Use Typeable to infer name

containerStructure :: forall f a. (Typeable f, Structured a) => Proxy (f a) -> Structure Source #

genericStructure :: forall a. (Typeable a, Generic a, GStructured (Rep a)) => Proxy a -> Structure Source #

Derive structure genrically.

class GStructured (f :: Type -> Type) where Source #

Used to implement genericStructure.

Instances
(i ~ D, Datatype c, GStructuredSum f) => GStructured (M1 i c f) Source # 
Instance details

Defined in Data.Structured.Internal

class GStructuredSum (f :: Type -> Type) where Source #

Instances
GStructuredSum (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.Structured.Internal

(GStructuredSum f, GStructuredSum g) => GStructuredSum (f :+: g) Source # 
Instance details

Defined in Data.Structured.Internal

(i ~ C, Constructor c, GStructuredProd f) => GStructuredSum (M1 i c f) Source # 
Instance details

Defined in Data.Structured.Internal

class GStructuredProd (f :: Type -> Type) where Source #

Instances
GStructuredProd (U1 :: Type -> Type) Source # 
Instance details

Defined in Data.Structured.Internal

Structured c => GStructuredProd (K1 i c :: Type -> Type) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

gstructuredProd :: Proxy (K1 i c) -> [Structure] -> [Structure] Source #

(GStructuredProd f, GStructuredProd g) => GStructuredProd (f :*: g) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

gstructuredProd :: Proxy (f :*: g) -> [Structure] -> [Structure] Source #

(i ~ S, GStructuredProd f) => GStructuredProd (M1 i c f) Source # 
Instance details

Defined in Data.Structured.Internal

Methods

gstructuredProd :: Proxy (M1 i c f) -> [Structure] -> [Structure] Source #