Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Fantasy-Land method name into one place #214

Merged
merged 1 commit into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/All/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('All')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const isFunction = require('../core/isFunction')
const isNil = require('../core/isNil')
Expand Down Expand Up @@ -42,9 +43,9 @@ function All(b) {
return {
inspect, toString: inspect,
valueOf, type, concat, empty,
'@@type': _type,
'fantasy-land/concat': concat,
'fantasy-land/empty': empty,
['@@type']: _type,
[fl.concat]: concat,
[fl.empty]: empty,
constructor: All
}
}
Expand All @@ -56,7 +57,7 @@ All['@@implements'] = _implements(
All.empty = _empty
All.type = type

All['fantasy-land/empty'] = _empty
All[fl.empty] = _empty
All['@@type'] = _type

module.exports = All
9 changes: 5 additions & 4 deletions src/Any/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('Any')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const isFunction = require('../core/isFunction')
const isNil = require('../core/isNil')
Expand Down Expand Up @@ -42,9 +43,9 @@ function Any(b) {
return {
inspect, toString: inspect,
valueOf, type, concat, empty,
'@@type': _type,
'fantasy-land/concat': concat,
'fantasy-land/empty': empty,
['@@type']: _type,
[fl.concat]: concat,
[fl.empty]: empty,
constructor: Any
}
}
Expand All @@ -56,7 +57,7 @@ Any['@@implements'] = _implements(
Any.empty = _empty
Any.type = type

Any['fantasy-land/empty'] = _empty
Any[fl.empty] = _empty
Any['@@type'] = _type

module.exports = Any
15 changes: 8 additions & 7 deletions src/Arrow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('Arrow')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
Expand Down Expand Up @@ -91,20 +92,20 @@ function Arrow(runWith) {
inspect, toString: inspect, type,
runWith, id, compose, map, contramap,
promap, first, second, both,
'fantasy-land/id': id,
'fantasy-land/compose': compose,
'fantasy-land/contramap': contramap,
'fantasy-land/map': map,
'fantasy-land/promap': promap,
'@@type': _type,
[fl.id]: id,
[fl.compose]: compose,
[fl.contramap]: contramap,
[fl.map]: map,
[fl.promap]: promap,
['@@type']: _type,
constructor: Arrow
}
}

Arrow.id = _id
Arrow.type = type

Arrow['fantasy-land/id'] = _id
Arrow[fl.id] = _id
Arrow['@@type'] = _type

Arrow['@@implements'] = _implements(
Expand Down
9 changes: 5 additions & 4 deletions src/Assign/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const _object = require('../core/object')

const type = require('../core/types').type('Assign')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const isNil = require('../core/isNil')
const isObject = require('../core/isObject')
Expand Down Expand Up @@ -44,9 +45,9 @@ function Assign(o) {
return {
inspect, toString: inspect,
valueOf, type, concat, empty,
'fantasy-land/empty': empty,
'fantasy-land/concat': concat,
'@@type': _type,
[fl.empty]: empty,
[fl.concat]: concat,
['@@type']: _type,
constructor: Assign
}
}
Expand All @@ -58,7 +59,7 @@ Assign['@@implements'] = _implements(
Assign.empty = _empty
Assign.type = type

Assign['fantasy-land/empty'] = _empty
Assign[fl.empty] = _empty
Assign['@@type'] = _type

module.exports = Assign
15 changes: 8 additions & 7 deletions src/Async/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('Async')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const array = require('../core/array')
const compose = require('../core/compose')
Expand Down Expand Up @@ -243,20 +244,20 @@ function Async(fn, parentCancel) {
toString: inspect, type,
swap, coalesce, map, bimap,
alt, ap, chain, of,
'fantasy-land/of': of,
'fantasy-land/alt': alt,
'fantasy-land/bimap': bimap,
'fantasy-land/map': map,
'fantasy-land/chain': chain,
'@@type': _type,
[fl.of]: of,
[fl.alt]: alt,
[fl.bimap]: bimap,
[fl.map]: map,
[fl.chain]: chain,
['@@type']: _type,
constructor: Async
}
}

Async.of = _of
Async.type = type

Async['fantasy-land/of'] = _of
Async[fl.of] = _of
Async['@@type'] = _type

Async.Rejected = Rejected
Expand Down
11 changes: 6 additions & 5 deletions src/Const/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('Const')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
Expand Down Expand Up @@ -62,11 +63,11 @@ function Const(x) {
return {
inspect, toString: inspect, valueOf,
type, equals, concat, map, ap, chain,
'fantasy-land/equals': equals,
'fantasy-land/concat': concat,
'fantasy-land/map': map,
'fantasy-land/chain': chain,
'@@type': _type,
[fl.equals]: equals,
[fl.concat]: concat,
[fl.map]: map,
[fl.chain]: chain,
['@@type']: _type,
constructor: Const
}
}
Expand Down
19 changes: 10 additions & 9 deletions src/Either/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const _innerConcat = require('../core/innerConcat')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('Either')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const compose = require('../core/compose')
const isArray = require('../core/isArray')
Expand Down Expand Up @@ -199,22 +200,22 @@ function Either(u) {
type, concat, swap, coalesce, equals,
map, bimap, alt, ap, of, chain, sequence,
traverse,
'fantasy-land/of': of,
'fantasy-land/equals': equals,
'fantasy-land/alt': alt,
'fantasy-land/bimap': bimap,
'fantasy-land/concat': concat,
'fantasy-land/map': map,
'fantasy-land/chain': chain,
'@@type': _type,
[fl.of]: of,
[fl.equals]: equals,
[fl.alt]: alt,
[fl.bimap]: bimap,
[fl.concat]: concat,
[fl.map]: map,
[fl.chain]: chain,
['@@type']: _type,
constructor: Either
}
}

Either.of = _of
Either.type = type

Either['fantasy-land/of'] = _of
Either[fl.of] = _of
Either['@@type'] = _type

Either['@@implements'] = _implements(
Expand Down
9 changes: 5 additions & 4 deletions src/Endo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('Endo')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const compose = require('../core/compose')
const isFunction = require('../core/isFunction')
Expand Down Expand Up @@ -41,9 +42,9 @@ function Endo(runWith) {
inspect, toString: inspect,
valueOf, type, concat, empty,
runWith,
'fantasy-land/empty': empty,
'fantasy-land/concat': concat,
'@@type': _type,
[fl.empty]: empty,
[fl.concat]: concat,
['@@type']: _type,
constructor: Endo
}
}
Expand All @@ -55,7 +56,7 @@ Endo['@@implements'] = _implements(
Endo.empty = _empty
Endo.type = type

Endo['fantasy-land/empty'] = _empty
Endo[fl.empty] = _empty
Endo['@@type'] = _type

module.exports = Endo
Expand Down
11 changes: 6 additions & 5 deletions src/Equiv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const isSameType = require('../core/isSameType')

const type = require('../core/types').type('Equiv')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const _empty =
() => Equiv(() => true)
Expand Down Expand Up @@ -58,18 +59,18 @@ function Equiv(compare) {
inspect, toString: inspect, type,
compareWith, valueOf, contramap,
concat, empty,
'fantasy-land/empty': empty,
'fantasy-land/concat': concat,
'fantasy-land/contramap': contramap,
'@@type': _type,
[fl.empty]: empty,
[fl.concat]: concat,
[fl.contramap]: contramap,
['@@type']: _type,
constructor: Equiv
}
}

Equiv.empty = _empty
Equiv.type = type

Equiv['fantasy-land/empty'] = _empty
Equiv[fl.empty] = _empty
Equiv['@@type'] = _type

Equiv['@@implements'] = _implements(
Expand Down
9 changes: 5 additions & 4 deletions src/First/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('First')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const isSameType = require('../core/isSameType')

Expand Down Expand Up @@ -52,9 +53,9 @@ function First(x) {
inspect, toString: inspect,
concat, empty, option, type,
valueOf,
'fantasy-land/empty': _empty,
'fantasy-land/concat': concat,
'@@type': _type,
[fl.empty]: _empty,
[fl.concat]: concat,
['@@type']: _type,
constructor: First
}
}
Expand All @@ -66,7 +67,7 @@ First['@@implements'] = _implements(
First.empty = _empty
First.type = type

First['fantasy-land/empty'] = _empty
First[fl.empty] = _empty
First['@@type'] = _type

module.exports = First
11 changes: 6 additions & 5 deletions src/IO/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('IO')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const compose = require('../core/compose')
const isFunction = require('../core/isFunction')
Expand Down Expand Up @@ -61,18 +62,18 @@ function IO(run) {
return {
inspect, toString: inspect, run,
type, map, ap, of, chain,
'fantasy-land/of': of,
'fantasy-land/map': map,
'fantasy-land/chain': chain,
'@@type': _type,
[fl.of]: of,
[fl.map]: map,
[fl.chain]: chain,
['@@type']: _type,
constructor: IO
}
}

IO.of = _of
IO.type = type

IO['fantasy-land/of'] = _of
IO[fl.of] = _of
IO['@@type'] = _type

IO['@@implements'] = _implements(
Expand Down
15 changes: 8 additions & 7 deletions src/Identity/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const _innerConcat = require('../core/innerConcat')
const _inspect = require('../core/inspect')
const type = require('../core/types').type('Identity')
const _type = require('../core/types').typeFn(type(), VERSION)
const fl = require('../core/flNames')

const isArray = require('../core/isArray')
const isApply = require('../core/isApply')
Expand Down Expand Up @@ -108,20 +109,20 @@ function Identity(x) {
inspect, toString: inspect, valueOf,
type, equals, concat, map, ap, of,
chain, sequence, traverse,
'fantasy-land/of': of,
'fantasy-land/equals': equals,
'fantasy-land/concat': concat,
'fantasy-land/map': map,
'fantasy-land/chain': chain,
'@@type': _type,
[fl.of]: of,
[fl.equals]: equals,
[fl.concat]: concat,
[fl.map]: map,
[fl.chain]: chain,
['@@type']: _type,
constructor: Identity
}
}

Identity.of = _of
Identity.type = type

Identity['fantasy-land/of'] = _of
Identity[fl.of] = _of
Identity['@@type'] = _type

Identity['@@implements'] = _implements(
Expand Down
Loading