source: node_modules/ramda-adjunct/src/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: 589 bytes
Line 
1import {
2 useWith,
3 curry,
4 curryN,
5 equals,
6 path,
7 either,
8 complement,
9} from 'ramda';
10
11// type :: Monad a => a -> String
12export const type = either(path(['@@type']), path(['constructor', '@@type']));
13
14// typeEquals :: Monad a => String -> a -> Boolean
15export const typeEquals = curry(
16 (typeIdent, monad) => type(monad) === typeIdent
17);
18
19// isSameType :: (Monad a, Monad b) => a -> b -> Boolean
20export const isSameType = curryN(2, useWith(equals, [type, type]));
21
22// isNotSameType :: (Monad a, Monad b) => a -> b -> Boolean
23export const isNotSameType = complement(isSameType);
Note: See TracBrowser for help on using the repository browser.