Skip to content

Commit

Permalink
Merge a62c772 into 4bb0bb2
Browse files Browse the repository at this point in the history
  • Loading branch information
joelnet committed May 15, 2019
2 parents 4bb0bb2 + a62c772 commit e4f7de4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.yml
Expand Up @@ -5,9 +5,7 @@ env:
browser: false
extends: airbnb-base
parserOptions:
ecmaVersion: 2017
ecmaFeatures:
experimentalObjectRestSpread: true
ecmaVersion: 2018
rules:
indent:
- error
Expand Down
8 changes: 2 additions & 6 deletions type/Nothing.js
@@ -1,9 +1,5 @@
const { typeNothing } = require('./_allTypes')

function leftMap(func) {
const value = func()
return value
}
const Just = require('./Just')

const Nothing = Object.freeze(Object.create(
{
Expand All @@ -12,7 +8,7 @@ const Nothing = Object.freeze(Object.create(
inspect: () => 'Nothing',
ap: () => Nothing,
map: () => Nothing,
leftMap,
leftMap: func => Just(func()),
flatMap: () => Nothing,
'fantasy-land/map': () => Nothing,
toJSON: () => null
Expand Down
4 changes: 2 additions & 2 deletions type/__tests__/Nothing.test.js
Expand Up @@ -31,15 +31,15 @@ describe('type/Nothing', () => {
expect.assertions(1)
const expected = 'Just ("ABC")'
const nothing = Nothing
const actual = nothing.leftMap(() => Just('ABC')).inspect()
const actual = nothing.leftMap(() => 'ABC').inspect()
expect(actual).toBe(expected)
})

test('leftMap with Nothing', () => {
expect.assertions(1)
const expected = Nothing
const nothing = Nothing
const actual = nothing.leftMap(() => Nothing)
const actual = nothing.leftMap(() => Nothing).value
expect(actual).toBe(expected)
})

Expand Down

0 comments on commit e4f7de4

Please sign in to comment.