Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data IndigoObjectF f a where
- Cell :: KnownValue a => RefId -> IndigoObjectF f a
- Decomposed :: ComplexObjectC a => Rec f (ConstructorFieldNames a) -> IndigoObjectF f a
- data NamedFieldObj a name where
- NamedFieldObj :: IsObject (GetFieldType a name) => {..} -> NamedFieldObj a name
- data TypedFieldObj a where
- TypedFieldObj :: IsObject a => Object a -> TypedFieldObj a
- type FieldTypes a = MapGFT a (ConstructorFieldNames a)
- type Object a = IndigoObjectF (NamedFieldObj a) a
- data SomeObject where
- 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)
- typedToNamedRec :: forall a f g. KnownList (ConstructorFieldNames a) => (forall name. f (GetFieldType a name) -> g name) -> Rec f (FieldTypes a) -> Rec g (ConstructorFieldNames a)
- namedToTypedFieldObj :: forall a name. NamedFieldObj a name -> TypedFieldObj (GetFieldType a name)
- typedToNamedFieldObj :: forall a name. TypedFieldObj (GetFieldType a name) -> NamedFieldObj a name
- class IsObject' (TypeDecision a) a => IsObject a
- complexObjectDict :: forall a. IsObject a => Maybe (Dict (ComplexObjectC a))
- type ComplexObjectC a = (ToDeconstructC a, ToConstructC a, AllConstrained IsObject (FieldTypes a))
- castFieldConstructors :: forall a st. CastFieldConstructors (FieldTypes a) (ConstructorFieldTypes a) => Rec (FieldConstructor st) (FieldTypes a) -> Rec (FieldConstructor st) (ConstructorFieldTypes a)
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.
Cell :: KnownValue a => RefId -> IndigoObjectF f a | Value stored on the stack, it might be
either complex product type, like |
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
NamedFieldObj | |
|
data TypedFieldObj a where Source #
Like NamedFieldObj
, but this one doesn't keep name of a field
TypedFieldObj :: IsObject a => Object a -> TypedFieldObj a |
type FieldTypes a = MapGFT a (ConstructorFieldNames a) Source #
type Object a = IndigoObjectF (NamedFieldObj a) a Source #
data SomeObject where Source #
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
namedToTypedFieldObj :: forall a name. NamedFieldObj a name -> TypedFieldObj (GetFieldType a name) Source #
typedToNamedFieldObj :: forall a name. TypedFieldObj (GetFieldType a name) -> NamedFieldObj a name Source #
class IsObject' (TypeDecision a) a => IsObject a Source #
Instances
IsObject' (TypeDecision a) a => IsObject a Source # | |
Defined in Indigo.Internal.Object |
complexObjectDict :: forall a. IsObject a => Maybe (Dict (ComplexObjectC a)) Source #
type ComplexObjectC a = (ToDeconstructC a, ToConstructC a, AllConstrained IsObject (FieldTypes a)) Source #
castFieldConstructors :: forall a st. CastFieldConstructors (FieldTypes a) (ConstructorFieldTypes a) => Rec (FieldConstructor st) (FieldTypes a) -> Rec (FieldConstructor st) (ConstructorFieldTypes a) Source #