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
|
Line | |
---|
1 | import { useWith, curry, curryN, equals, path, either, complement } from 'ramda';
|
---|
2 |
|
---|
3 | // type :: Monad a => a -> String
|
---|
4 | export var type = either(path(['@@type']), path(['constructor', '@@type']));
|
---|
5 |
|
---|
6 | // typeEquals :: Monad a => String -> a -> Boolean
|
---|
7 | export var typeEquals = curry(function (typeIdent, monad) {
|
---|
8 | return type(monad) === typeIdent;
|
---|
9 | });
|
---|
10 |
|
---|
11 | // isSameType :: (Monad a, Monad b) => a -> b -> Boolean
|
---|
12 | export var isSameType = curryN(2, useWith(equals, [type, type]));
|
---|
13 |
|
---|
14 | // isNotSameType :: (Monad a, Monad b) => a -> b -> Boolean
|
---|
15 | export var isNotSameType = complement(isSameType); |
---|
Note:
See
TracBrowser
for help on using the repository browser.