Haskell-style typeclasses for Nim.
Allows to instantiate collections of functions for a given type or type constructor.
$ nimble install classy
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"]
Module documentation is located here.
Also refer to example for a quick tutorial.
$ nimble tests
Highly experimental. API and behaviour subject to change.
The Unlicense. Please see License File for more information.