No description
Find a file
2021-04-01 20:08:57 +07:00
tests Fix a test 2021-04-01 19:31:15 +07:00
.gitignore Clean up test tasks 2016-12-27 22:21:00 +07:00
.travis.yml Add more Nim versions 2021-04-01 19:35:50 +07:00
classy.nim backwards compatibility 2020-04-16 15:42:18 +02:00
classy.nimble Bump development version 2021-04-01 20:08:57 +07:00
config.nims Clean up test tasks 2016-12-27 22:21:00 +07:00
example.nim Fix replacement outside routines. 2016-10-30 23:01:52 +07:00
license.md Initial commit 2016-10-23 23:18:26 +07:00
readme.md Update Travis link in the readme 2020-03-30 12:42:32 +07:00

Classy

Software License Stability Travis

nimble

Haskell-style typeclasses for Nim.

Allows to instantiate collections of functions for a given type or type constructor.

Install

$ nimble install classy

Usage

import classy, future

typeclass Functor, F[_]:
  # proc map[A, B](fa: F[A], g: A -> B): F[B]
  proc `$>`[A, B](fa: F[A], b: B): F[B] =
    fa.map((a: A) => g)

instance Functor, seq[_]
assert: (@[1, 2, 3] $> "a") == @["a", "a", "a"]

Documentation

Module documentation is located here.

Also refer to example for a quick tutorial.

Testing

$ nimble tests

Stability

Highly experimental. API and behaviour subject to change.

Credits

License

The Unlicense. Please see License File for more information.