Time Framework: A Type Level and Algebra Driven Design Approach
Time is present in every real world data model. Literature on the subject includes several time models, algebras, formal logics, and ontologies. Furthermore, Functional Programming, Type-level Programming and Algebra Driven Design are valuable assets for constructing systems that are consistent, com...
Saved in:
Published in | 2021 International Conference on Data Analytics for Business and Industry (ICDABI) pp. 413 - 418 |
---|---|
Main Authors | , , |
Format | Conference Proceeding |
Language | English |
Published |
IEEE
25.10.2021
|
Subjects | |
Online Access | Get full text |
Cover
Loading…
Summary: | Time is present in every real world data model. Literature on the subject includes several time models, algebras, formal logics, and ontologies. Furthermore, Functional Programming, Type-level Programming and Algebra Driven Design are valuable assets for constructing systems that are consistent, composable, extensible, highly polymorphic, and predictable. Nevertheless, there is a lack for a purely functional typed time framework that offers ways to construct type safe algebraic time structures and prove their algebraic laws. Our study answers this need by introducing a purely functional typed, highly extensible and polymorphic framework to encode time algebras. The framework can be used to build type safe, composable systems for processing time points and periods with laws as consistency proofs and compile-time optimisation rules. The language used to implement our library is Haskell, which is a purely functional, statically and strongly typed language. Additionally, the library includes dependent types, compile-time reflection, type families, and refined types. As for proofs, they are written as randomised property tests with QuickSpec, or enumerative property tests with SmallCheck. To demonstrate the utility of the framework, we provide two use cases that describe how to construct a time point and period algebraic structure, and how to assert that laws about them hold. |
---|---|
DOI: | 10.1109/ICDABI53623.2021.9655926 |