Small, simple POC for type checking of functional data types. No production dependencies, only ~3KB (1.3KB gzipped).
- All you need is either node or a browser
- Works on any machine
- No dependencies on other packages (with the exception of dev dependencies to build for browsers)
- Unit testing
- Debugging
- Other assertions
funchecks.isFunctor(object)
funchecks.isMonad(object)
funchecks.isMonoid(object, type?)
funchecks.isSemigroup(object, type?)
funchecks.typeOfData(object, type?)
Return string is a constant that should be checked against funchecks.dataTypes
Examples:
//string is a semigroup
funchecks.typeOfData('what am I?') === funchecks.dataTypes.SEMIGROUP;
//array is a functor
funchecks.typeOfData([]) === funchecks.dataTypes.FUNCTOR;
- FUNCTOR
- SEMIGROUP
- MONOID
- MONAD
Npm:
npm install --save funchecks
Browser:
<script src="funchecks.js"></script>
MIT