source: node_modules/ramda-adjunct/es/fantasy-land/util.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 581 bytes
RevLine 
[d24f17c]1import { useWith, curry, curryN, equals, path, either, complement } from 'ramda';
2
3// type :: Monad a => a -> String
4export var type = either(path(['@@type']), path(['constructor', '@@type']));
5
6// typeEquals :: Monad a => String -> a -> Boolean
7export var typeEquals = curry(function (typeIdent, monad) {
8 return type(monad) === typeIdent;
9});
10
11// isSameType :: (Monad a, Monad b) => a -> b -> Boolean
12export var isSameType = curryN(2, useWith(equals, [type, type]));
13
14// isNotSameType :: (Monad a, Monad b) => a -> b -> Boolean
15export var isNotSameType = complement(isSameType);
Note: See TracBrowser for help on using the repository browser.