UNPKG

moy-fp

Version:
25 lines (21 loc) 514 B
import __ from '../../src/Function/__' /** * Maybe m => b -> (a -> b) -> m a -> b */ import maybe from '../../src/Functor/maybe' import Maybe from '../../src/Functor/Maybe/index' test('maybe(not using __), null', () => { expect( maybe(1)(x => x + 1)(Maybe.of(null)) ).toBe(1) }) test('maybe(not using __), not null', () => { expect( maybe(1)(x => x + 1)(Maybe.of(12)) ).toBe(13) }) test('maybe(using __), not null', () => { expect( maybe(1, __, Maybe.of(12))(x => x + 1) ).toBe(13) })