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

Safe HaskellNone




newtype Object u Source

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




unObject :: Table

newtype Table Source

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



class Objective o whereSource

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


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.



:: 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.