Permalink
Browse files

(re) Have core module's names reflect the functionality they expose

  • Loading branch information...
robotlolita committed Oct 16, 2016
1 parent b7eeb11 commit 8e1b27e2d2e282f49cc5fa08ce1069df7aed59ca
@@ -369,7 +369,7 @@ instead to check if a value belongs to the ADT variant.`);
* );
*
* Here the result of `fetch` can be either a response or an error, like in
* the `readFile` example, but the only way of getting to that value is
* the `readFile` exammple, but the only way of getting to that value is
* through the `then` function, which requires you to define separate branches
* for handling each case. This way it's not possible to forget to deal with
* one of the cases, or make mistakes in the branching condition, such as
View
@@ -24,7 +24,7 @@
* easy way. The `data` function provided by this module achieves that
* goal::
*
* const data = require('folktale/core/adt/core');
* const data = require('folktale/core/adt/data');
*
* const Maybe = data('Maybe', {
* Some(value){ return { value } },
@@ -81,7 +81,7 @@
* category : Data Structures
*/
module.exports = {
data: require('./core'),
data: require('./data'),
setoid: require('./setoid'),
show: require('./show'),
serialize: require('./serialize')
@@ -8,7 +8,7 @@
//----------------------------------------------------------------------
// --[ Dependencies ]---------------------------------------------------
const { tagSymbol, typeSymbol } = require('./core');
const { tagSymbol, typeSymbol } = require('./data');
const mapValues = require('folktale/core/object/map-values');
const values = require('folktale/core/object/values');
@@ -140,7 +140,7 @@ const serializeValue = (value) =>
* which converts rich ADTs into objects that can be safely serialised as
* JSON. For example::
*
* const data = require('folktale/core/adt/core');
* const data = require('folktale/core/adt/data');
* const { Id } = data('Id', {
* Id(value){ return { value } }
* }).derive(serialize);
View
@@ -12,7 +12,7 @@ const assertType = require('folktale/helpers/assertType');
const { equals:flEquals } = require('folktale/core/fantasy-land');
const fl = require('folktale/helpers/fantasy-land');
const provideAliases = require('folktale/helpers/provide-fantasy-land-aliases');
const { tagSymbol, typeSymbol } = require('./core');
const { tagSymbol, typeSymbol } = require('./data');
// --[ Helpers ]--------------------------------------------------------
View
@@ -8,7 +8,7 @@
//----------------------------------------------------------------------
// --[ Dependencies ]---------------------------------------------------
const { tagSymbol, typeSymbol } = require('./core');
const { tagSymbol, typeSymbol } = require('./data');
// --[ Helpers ]--------------------------------------------------------
@@ -10,7 +10,7 @@
//
//----------------------------------------------------------------------
const { Just, Nothing } = require('folktale/data/maybe/core');
const { Just, Nothing } = require('folktale/data/maybe/maybe');
/*~
@@ -10,7 +10,7 @@
//
//----------------------------------------------------------------------
const { Success, Failure } = require('folktale/data/validation/core');
const { Success, Failure } = require('folktale/data/validation/validation');
/*~
@@ -10,7 +10,7 @@
//
//----------------------------------------------------------------------
const { Left, Right } = require('folktale/data/either/core');
const { Left, Right } = require('folktale/data/either/either');
/*~
@@ -9,7 +9,7 @@
// See CONTRIBUTORS for the list of contributors to the project.
//
//----------------------------------------------------------------------
const { Success, Failure } = require('folktale/data/validation/core');
const { Success, Failure } = require('folktale/data/validation/validation');
/*~
@@ -10,7 +10,7 @@
//
//----------------------------------------------------------------------
const { Left, Right } = require('folktale/data/either/core');
const { Left, Right } = require('folktale/data/either/either');
/*~
@@ -10,7 +10,7 @@
//
//----------------------------------------------------------------------
const { Nothing, Just } = require('folktale/data/maybe/core');
const { Nothing, Just } = require('folktale/data/maybe/maybe');
/*~
@@ -9,7 +9,7 @@
// See CONTRIBUTORS for the list of contributors to the project.
//
//----------------------------------------------------------------------
const { Success, Failure } = require('folktale/data/validation/core');
const { Success, Failure } = require('folktale/data/validation/validation');
/*~
@@ -11,7 +11,7 @@
//
//----------------------------------------------------------------------
const { Left, Right } = require('folktale/data/either/core');
const { Left, Right } = require('folktale/data/either/either');
/*~
@@ -10,7 +10,7 @@
//
//----------------------------------------------------------------------
const { Just, Nothing } = require('folktale/data/maybe/core');
const { Just, Nothing } = require('folktale/data/maybe/maybe');
/*~
File renamed without changes.
@@ -1,4 +1,4 @@
const { Left, Right } = require('./core');
const { Left, Right } = require('./either');
module.exports = (a) =>
a != null ? Right(a)
View
@@ -11,7 +11,7 @@
//----------------------------------------------------------------------
module.exports = {
...require('./core'),
...require('./either'),
try: require('./try'),
fromNullable: require('folktale/data/conversions/nullable-to-either'),
fromValidation: require('folktale/data/conversions/validation-to-either'),
View
@@ -1,4 +1,4 @@
const { Left, Right } = require('./core');
const { Left, Right } = require('./either');
module.exports = (f) => (...args) => {
try {
View
@@ -11,7 +11,7 @@
//----------------------------------------------------------------------
module.exports = {
...require('./core'),
...require('./maybe'),
fromEither: require('folktale/data/conversions/either-to-maybe'),
fromValidation: require('folktale/data/conversions/validation-to-maybe')
};
@@ -18,7 +18,7 @@ const provideAliases = require('folktale/helpers/provide-fantasy-land-aliases');
const Maybe = data('folktale:Data.Maybe', {
Nothing() { },
Just(value) { return { value } }
}).derive(setoid, show);
}).derive(setoid, show, setoid);
const { Nothing, Just } = Maybe;
@@ -131,4 +131,4 @@ provideAliases(Just.prototype);
provideAliases(Nothing.prototype);
provideAliases(Maybe);
module.exports = Maybe;
module.exports = Maybe;
@@ -1,4 +1,4 @@
const { Success, Failure } = require('./core');
const { Success, Failure } = require('./validation');
module.exports = (a) =>
a != null ? Success(a)
@@ -11,7 +11,7 @@
//----------------------------------------------------------------------
module.exports = {
...require('./core'),
...require('./validation'),
fromNullable: require('folktale/data/conversions/nullable-to-validation'),
fromEither: require('folktale/data/conversions/either-to-validation'),
fromMaybe: require('folktale/data/conversions/maybe-to-validation')
File renamed without changes.
@@ -1,4 +1,4 @@
const { typeSymbol } = require('folktale/core/adt/core');
const { typeSymbol } = require('folktale/core/adt/data');
module.exports = (type) => (method, value) => {
const typeName = type[typeSymbol];
View
@@ -17,17 +17,9 @@
* > This documentation is a stub and needs to be improved. It should give
* > pointers on where to start on functional programming and Folktale.
*
* --------------------------------------------------------------------
* ---
* name : module folktale
* module : folktale
* copyright : (c) 2015-2016 Quildreen Motta, and CONTRIBUTORS
* licence : MIT
* repository : https://github.com/origamitower/folktale
*
* category : Functional Programming
*
* maintainers:
* - Quildreen Motta <queen@robotlolita.me>
*/
module.exports = {
core: require('./core'),

0 comments on commit 8e1b27e

Please sign in to comment.