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

Safe HaskellNone

Data.Object.Dynamic.Presets

Description

This module provides two presets for the Object: DIT for daily use, and Precise for arbitrary precision calculations.

Synopsis

Documentation

data DIT Source

Object DIT uses Double for real numbers, Int for integers and Text for strings.

>>> typechecks :: (UnderlyingReal (Object DIT) ~ Double) => Bool
True
>>> typechecks :: (UnderlyingInteger (Object DIT) ~ Int) => Bool
True
>>> typechecks :: (UnderlyingString (Object DIT) ~ Data.Text.Text) => Bool
True

data Precise Source

Object Precise uses Double for real numbers, Int for integers and Text for strings.

>>> typechecks :: (UnderlyingReal (Object Precise) ~ Rational) => Bool
True
>>> typechecks :: (UnderlyingInteger (Object Precise) ~ Integer) => Bool
True
>>> typechecks :: (UnderlyingString (Object Precise) ~ Data.Text.Text) => Bool
True