dynamic-object-0.2: Object-oriented programming with duck typing and singleton classes.

Safe HaskellNone

Data.Object.Dynamic.Types

Synopsis

Documentation

newtype Object u Source

The Object type, where u carrying the information of its underlying types.

Constructors

Object 

Fields

unObject :: Table
 

newtype Table Source

The Table within an Object that carries all the member data.

Constructors

Table 

class Objective o whereSource

o is an Objective if given its type information, there is an equivalence between o and the Table.

Instances

class (Objective o, Typeable memb, Typeable (ValType o memb)) => Member o memb Source

This means that memb is one of the member labels of o. The ValType of the member depends both on the label and (the underlying types of) the object.

Associated Types

type ValType o memb :: *Source

type MemberLens o memb = Member o memb => Simple Traversal o (ValType o memb)Source

The lens for accessing the Member of the Object.

memberLensDefSource

Arguments

:: Member o memb 
=> memb

member label

-> (o -> Maybe (ValType o memb))

default value, in case the member is not in the map

-> MemberLens o memb

generated lens

A utility function for creating a MemberLens .

memberLens :: Member o memb => memb -> MemberLens o membSource

create a MemberLens without any default values.

insert :: (Objective o, Member o memb, ValType o memb ~ val, Typeable memb, Typeable val) => memb -> val -> o -> oSource

Given a pair of Member label and a value, create the data field for the member and inserts the value.