indigo-0.5.0: Convenient imperative eDSL over Lorentz.
Safe HaskellNone
LanguageHaskell2010

Indigo.Internal.Object

Synopsis

Documentation

data IndigoObjectF f a where Source #

A object that can be either stored in the single stack cell or split into fields. Fields are identified by their names.

f is a functor to be applied to each of field names.

Constructors

Cell :: KnownValue a => RefId -> IndigoObjectF f a

Value stored on the stack, it might be either complex product type, like (a, b), Storage, etc, or sum type like Either, or primitive like Int, Operation, etc.

Decomposed :: ComplexObjectC a => Rec f (ConstructorFieldNames a) -> IndigoObjectF f a

Decomposed product type, which is NOT stored as one cell on the stack.

data NamedFieldObj a name where Source #

Auxiliary datatype to define a Objiable. Keeps field name as type param

Constructors

NamedFieldObj 

Fields

data TypedFieldObj a where Source #

Like NamedFieldObj, but this one doesn't keep name of a field

Constructors

TypedFieldObj :: IsObject a => Object a -> TypedFieldObj a 

data SomeObject where Source #

Constructors

SomeObject :: IsObject a => Object a -> SomeObject 

namedToTypedRec :: forall a f g. (forall name. f name -> g (GetFieldType a name)) -> Rec f (ConstructorFieldNames a) -> Rec g (FieldTypes a) Source #

Convert a list of fields from name-based list to type-based one

typedToNamedRec :: forall a f g. KnownList (ConstructorFieldNames a) => (forall name. f (GetFieldType a name) -> g name) -> Rec f (FieldTypes a) -> Rec g (ConstructorFieldNames a) Source #

Convert a list of fields from type-based list to named-based one

class IsObject' (TypeDecision a) a => IsObject a Source #

Instances

Instances details
IsObject' (TypeDecision a) a => IsObject a Source # 
Instance details

Defined in Indigo.Internal.Object

type ComplexObjectC a = (ToDeconstructC a, ToConstructC a, AllConstrained IsObject (FieldTypes a), RecordToList (FieldTypes a)) Source #