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