source: node_modules/ramda-adjunct/lib/fantasy-land/util.js

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

Initial commit

  • Property mode set to 100644
File size: 849 bytes
Line 
1"use strict";
2
3exports.__esModule = true;
4exports.typeEquals = exports.type = exports.isSameType = exports.isNotSameType = void 0;
5var _ramda = require("ramda");
6// type :: Monad a => a -> String
7var type = (0, _ramda.either)((0, _ramda.path)(['@@type']), (0, _ramda.path)(['constructor', '@@type']));
8
9// typeEquals :: Monad a => String -> a -> Boolean
10exports.type = type;
11var typeEquals = (0, _ramda.curry)(function (typeIdent, monad) {
12 return type(monad) === typeIdent;
13});
14
15// isSameType :: (Monad a, Monad b) => a -> b -> Boolean
16exports.typeEquals = typeEquals;
17var isSameType = (0, _ramda.curryN)(2, (0, _ramda.useWith)(_ramda.equals, [type, type]));
18
19// isNotSameType :: (Monad a, Monad b) => a -> b -> Boolean
20exports.isSameType = isSameType;
21var isNotSameType = (0, _ramda.complement)(isSameType);
22exports.isNotSameType = isNotSameType;
Note: See TracBrowser for help on using the repository browser.