The cluss package

[Tags:bsd3, library]

A cluss enables you to achieve function overloading, or ad-hoc polymorphism, without creating a new type class.

In order to give ad-hoc polymorphism to a type variable a, you simply use In with a list of "type patterns" like In [Type T, ...] a, which indicates that the type matches some of the patterns; which is analogous to a type class indicating that a type matches some of its "instances". The constraint In [Type T, ...] a is what we call a "cluss".

Clusses can easily be used in a nested way and even be recursive; therefore, they are expressive enough to imitate Haskell-98-style type classes.

Clusses, however, go beyond a mere alternative to type classes. They have closed and prioritized instances and open methods, while type classes have open and unprioritized instances and closed methods. Those properties give clusses the advantages different from type classes:

More information can be found in the hackage's haddock or the updated haddock.

Properties

Versions 0.1, 0.2, 0.3
Dependencies base (==4.*), template-haskell (>=2.5) [details]
License BSD3
Copyright (c) Yusuke Matsushita 2014
Author Yusuke Matsushita
Maintainer Yusuke Matsushita <y.skm24t@gmail.com>
Category type system, constraints
Home page https://github.com/Kinokkory/cluss
Bug tracker https://github.com/Kinokkory/cluss/issues
Source repository head: git clone git@github.com:Kinokkory/cluss.git
Uploaded Tue Oct 14 08:06:01 UTC 2014 by Kinokkory
Distributions NixOS:0.3
Downloads 686 total (20 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees