Skip to content
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
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
module.exports =
require('./src')
import crocks from './src/index.js'

export default crocks
23 changes: 12 additions & 11 deletions src/All/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@

const VERSION = 2

const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const _equals = require('../core/equals')
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')
const isSameType = require('../core/isSameType')
import _implements from '../core/implements.js'
import _inspect from '../core/inspect.js'
import _equals from '../core/equals.js'
import types from '../core/types.js'
const type = types.type('All')
const _type = types.typeFn(type(), VERSION)
import fl from '../core/flNames.js'

import isFunction from '../core/isFunction.js'
import isNil from '../core/isNil.js'
import isSameType from '../core/isSameType.js'

const _empty =
() => All(true)
Expand Down Expand Up @@ -66,4 +67,4 @@ All.type = type
All[fl.empty] = _empty
All['@@type'] = _type

module.exports = All
export default All
23 changes: 12 additions & 11 deletions src/Any/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@

const VERSION = 2

const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const _equals = require('../core/equals')
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')
const isSameType = require('../core/isSameType')
import _implements from '../core/implements.js'
import _inspect from '../core/inspect.js'
import _equals from '../core/equals.js'
import types from '../core/types.js'
const type = types.type('Any')
const _type = types.typeFn(type(), VERSION)
import fl from '../core/flNames.js'

import isFunction from '../core/isFunction.js'
import isNil from '../core/isNil.js'
import isSameType from '../core/isSameType.js'

const _empty =
() => Any(false)
Expand Down Expand Up @@ -66,4 +67,4 @@ Any.type = type
Any[fl.empty] = _empty
Any['@@type'] = _type

module.exports = Any
export default Any
19 changes: 10 additions & 9 deletions src/Arrow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@

const VERSION = 1

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')
import _implements from '../core/implements.js'
import _inspect from '../core/inspect.js'
import types from '../core/types.js'
const type = types.type('Arrow')
const _type = types.typeFn(type(), VERSION)
import fl from '../core/flNames.js'

const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
import isFunction from '../core/isFunction.js'
import isSameType from '../core/isSameType.js'

const Pair = require('../core/types').proxy('Pair')
const Pair = types.proxy('Pair')

const _id =
() => Arrow(x => x)
Expand Down Expand Up @@ -112,4 +113,4 @@ Arrow['@@implements'] = _implements(
[ 'compose', 'contramap', 'id', 'map', 'promap' ]
)

module.exports = Arrow
export default Arrow
23 changes: 12 additions & 11 deletions src/Assign/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@

const VERSION = 2

const _implements = require('../core/implements')
const _inspect = require('../core/inspect')
const _object = require('../core/object')
const _equals = require('../core/equals')
import _implements from '../core/implements.js'
import _inspect from '../core/inspect.js'
import _object from '../core/object.js'
import _equals from '../core/equals.js'

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

const isNil = require('../core/isNil')
const isObject = require('../core/isObject')
const isSameType = require('../core/isSameType')
import isNil from '../core/isNil.js'
import isObject from '../core/isObject.js'
import isSameType from '../core/isSameType.js'

const _empty =
() => Assign({})
Expand Down Expand Up @@ -68,4 +69,4 @@ Assign.type = type
Assign[fl.empty] = _empty
Assign['@@type'] = _type

module.exports = Assign
export default Assign
13 changes: 7 additions & 6 deletions src/Async/eitherToAsync.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/** @license ISC License (c) copyright 2017 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */

const Async = require('.')
const Either = require('../core/types').proxy('Either')
import Async from './index.js'
import types from '../core/types.js'
const Either = types.proxy('Either')

const curry = require('../core/curry')
const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
import curry from '../core/curry.js'
import isFunction from '../core/isFunction.js'
import isSameType from '../core/isSameType.js'

const applyTransform = either =>
either.either(Async.Rejected, Async.Resolved)
Expand All @@ -33,4 +34,4 @@ function eitherToAsync(either) {
throw new TypeError('eitherToAsync: Either or Either returning function required')
}

module.exports = curry(eitherToAsync)
export default curry(eitherToAsync)
13 changes: 7 additions & 6 deletions src/Async/firstToAsync.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/** @license ISC License (c) copyright 2017 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */

const Async = require('.')
const First = require('../core/types').proxy('First')
import Async from './index.js'
import types from '../core/types.js'
const First = types.proxy('First')

const curry = require('../core/curry')
const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
import curry from '../core/curry.js'
import isFunction from '../core/isFunction.js'
import isSameType from '../core/isSameType.js'

const constant = x => () => x

Expand Down Expand Up @@ -38,4 +39,4 @@ function firstToAsync(left, first) {
throw new TypeError('firstToAsync: First or First returning function required for second argument')
}

module.exports = curry(firstToAsync)
export default curry(firstToAsync)
35 changes: 18 additions & 17 deletions src/Async/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@

const VERSION = 1

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')
const once = require('../core/once')
const unit = require('../core/_unit')

const isArray = require('../core/isArray')
const isFoldable = require('../core/isFoldable')
const isFunction = require('../core/isFunction')
const isPromise = require('../core/isPromise')
const isSameType = require('../core/isSameType')
import _implements from '../core/implements.js'
import _inspect from '../core/inspect.js'
import types from '../core/types.js'
const type = types.type('Async')
const _type = types.typeFn(type(), VERSION)
import fl from '../core/flNames.js'

import array from '../core/array.js'
import compose from '../core/compose.js'
import once from '../core/once.js'
import unit from '../core/_unit.js'

import isArray from '../core/isArray.js'
import isFoldable from '../core/isFoldable.js'
import isFunction from '../core/isFunction.js'
import isPromise from '../core/isPromise.js'
import isSameType from '../core/isSameType.js'

const allAsyncs = xs =>
xs.reduce((acc, x) => acc && isSameType(Async, x), true)
Expand Down Expand Up @@ -272,4 +273,4 @@ Async['@@implements'] = _implements(
[ 'alt', 'ap', 'bimap', 'chain', 'map', 'of' ]
)

module.exports = Async
export default Async
13 changes: 7 additions & 6 deletions src/Async/lastToAsync.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/** @license ISC License (c) copyright 2017 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */

const Async = require('.')
const Last = require('../core/types').proxy('Last')
import Async from './index.js'
import types from '../core/types.js'
const Last = types.proxy('Last')

const curry = require('../core/curry')
const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
import curry from '../core/curry.js'
import isFunction from '../core/isFunction.js'
import isSameType from '../core/isSameType.js'

const constant = x => () => x

Expand Down Expand Up @@ -38,4 +39,4 @@ function lastToAsync(left, last) {
throw new TypeError('lastToAsync: Last or Last returning function required for second argument')
}

module.exports = curry(lastToAsync)
export default curry(lastToAsync)
13 changes: 7 additions & 6 deletions src/Async/maybeToAsync.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/** @license ISC License (c) copyright 2017 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */

const Async = require('.')
const Maybe = require('../core/types').proxy('Maybe')
import Async from './index.js'
import types from '../core/types.js'
const Maybe = types.proxy('Maybe')

const curry = require('../core/curry')
const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
import curry from '../core/curry.js'
import isFunction from '../core/isFunction.js'
import isSameType from '../core/isSameType.js'

const constant = x => () => x

Expand Down Expand Up @@ -38,4 +39,4 @@ function maybeToAsync(left, maybe) {
throw new TypeError('maybeToAsync: Maybe or Maybe returning function required for second argument')
}

module.exports = curry(maybeToAsync)
export default curry(maybeToAsync)
13 changes: 7 additions & 6 deletions src/Async/resultToAsync.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/** @license ISC License (c) copyright 2017 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */

const Async = require('.')
const Result = require('../core/types').proxy('Result')
import Async from './index.js'
import types from '../core/types.js'
const Result = types.proxy('Result')

const curry = require('../core/curry')
const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
import curry from '../core/curry.js'
import isFunction from '../core/isFunction.js'
import isSameType from '../core/isSameType.js'

const applyTransform = either =>
either.either(Async.Rejected, Async.Resolved)
Expand All @@ -33,4 +34,4 @@ function resultToAsync(result) {
throw new TypeError('resultToAsync: Result or Result returning function required')
}

module.exports = curry(resultToAsync)
export default curry(resultToAsync)
19 changes: 10 additions & 9 deletions src/Const/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

const VERSION = 1

const _equals = require('../core/equals')
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')
import _equals from '../core/equals.js'
import _implements from '../core/implements.js'
import _inspect from '../core/inspect.js'
import types from '../core/types.js'
const type = types.type('Const')
const _type = types.typeFn(type(), VERSION)
import fl from '../core/flNames.js'

const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
import isFunction from '../core/isFunction.js'
import isSameType from '../core/isSameType.js'

function Const(x) {
if(!arguments.length) {
Expand Down Expand Up @@ -79,4 +80,4 @@ Const['@@implements'] = _implements(
[ 'ap', 'chain', 'concat', 'equals', 'map' ]
)

module.exports = Const
export default Const
13 changes: 7 additions & 6 deletions src/Either/firstToEither.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/** @license ISC License (c) copyright 2017 original and current authors */
/** @author Ian Hofmann-Hicks (evil) */

const Either = require('.')
const First = require('../core/types').proxy('First')
import Either from './index.js'
import types from '../core/types.js'
const First = types.proxy('First')

const curry = require('../core/curry')
const isFunction = require('../core/isFunction')
const isSameType = require('../core/isSameType')
import curry from '../core/curry.js'
import isFunction from '../core/isFunction.js'
import isSameType from '../core/isSameType.js'

const constant = x => () => x

Expand Down Expand Up @@ -38,4 +39,4 @@ function firstToEither(left, first) {
throw new TypeError('firstToEither: First or First returning function required for second argument')
}

module.exports = curry(firstToEither)
export default curry(firstToEither)
Loading