classy

typeclasses for Nim

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License Unlicense
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install classy
choosenim install classy
git clone https://github.com/nigredo-tori/classy

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
classy - - - - - - -

Source

Repository https://github.com/nigredo-tori/classy
Homepage https://github.com/nigredo-tori/classy
Registry Source nimble_official

README

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.