New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fjl

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fjl

Functional Javascript Library

  • 0.19.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
77
decreased by-54.17%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status GitHub version NPM version Dependencies

fjl

Functional Javascript Library

Beta Version

Note!!!

Beta version is the recommended version (head) (has at least 95% of haskell's List operations implemented) If you'd like the alpha version (previous version) it is tagged at 0.10.7 (this tag is also published on npm).

Motivations:

  • Haskell and it's Prelude.
  • Lambda Calculus.
  • The need for a way to do strong, and loose, type checking in combination, however necessary, in actual javascript code (not in typescript).
  • The need to be able to write functional code very quickly and easily in combination with the aforementioned.
  • A functional library that takes advantage of the es6 features of the language and is built from the ground up using functional concepts.
  • A functional library that is exported to multiple formats (umd, amd, commonjs, es6-modules, and iife).
  • "" that has both curried and un-curried versions of included operations. Et. al. append, _append (uncurrued)
  • Etc. etc..

Docs

Jsdocs here: https://functional-jslib.github.io/fjl/

Notable methods not added from the haskell prelude:

  • Math/Integral/Num/etc. methods
  • scan*, permutations and several others in the list's prelude (these are pending implementation)
  • Few others from prelude.

Included methods

Methods dealing with lists (strings/arrays etc.) and objects. Full list coming soon.

Needed

  • - Implementations of the scan* methods?
  • - "" of the Math methods?
  • - A friendly function names module has to be built for some of these functions as most javascript developers will not be familiar with the function names and paradigms used in haskell.
  • - Also some of the utility functions used to create the libraries functions should be exported with clear and meaningful names (they haven't been reviewed for export yet).

Reasoning for paradigms

Use of for loops instead of built-ins:

  • They are faster than iterating with functional array additions (map, forEach etc.) as you can see from many performance tests online @todo add references here (or writing your own @todo add references here).
  • They perform faster than while and do {} while {} loops.
  • They allow us to make our curried functional additions (map, some etc.) more performant than just currying the built in ones.

Sections in Readme:

Getting Started:

In Browser:

In the './dist' folder there are three distributed builds available for the browser:

  • './dist/iife' - Immediately Invoked Function Execution - (exports fjl as a global).
  • './dist/cjs' - CommonJs module format.
  • './dist/umd' - Universal module definition format.

In NodeJs:

Using CommonJs modules:
const fjl = require('fjl');
Using es2015 modules:
import {...} from 'fjl';

Fjl Members List:

Members, Properties and Methods:

fjl.all

@todo - Added documentation here. Back to fjl members list.

fjl.alwaysFalse

@todo - Added documentation here. Back to fjl members list.

fjl.alwaysTrue

@todo - Added documentation here. Back to fjl members list.

fjl.and

@todo - Added documentation here. Back to fjl members list.

fjl.any

@todo - Added documentation here. Back to fjl members list.

fjl.append

@todo - Added documentation here. Back to fjl members list.

fjl.appendMany

@todo - Added documentation here. Back to fjl members list.

fjl.apply

@todo - Added documentation here. Back to fjl members list.

fjl.assign

@todo - Added documentation here. Back to fjl members list.

fjl.assignDeep

@todo - Added documentation here. Back to fjl members list.

fjl.at

@todo - Added documentation here. Back to fjl members list.

fjl.breakOnList

@todo - Added documentation here. Back to fjl members list.

fjl.call

@todo - Added documentation here. Back to fjl members list.

fjl.complement

@todo - Added documentation here. Back to fjl members list.

fjl.compose

@todo - Added documentation here. Back to fjl members list.

fjl.concat

@todo - Added documentation here. Back to fjl members list.

fjl.concatMap

@todo - Added documentation here. Back to fjl members list.

fjl.curry

@todo - Added documentation here. Back to fjl members list.

fjl.curry2

@todo - Added documentation here. Back to fjl members list.

fjl.curry2_

@todo - Added documentation here. Back to fjl members list.

fjl.curry3

@todo - Added documentation here. Back to fjl members list.

fjl.curry3_

@todo - Added documentation here. Back to fjl members list.

fjl.curry4

@todo - Added documentation here. Back to fjl members list.

fjl.curry4_

@todo - Added documentation here. Back to fjl members list.

fjl.curry5

@todo - Added documentation here. Back to fjl members list.

fjl.curry5_

@todo - Added documentation here. Back to fjl members list.

fjl.curryN

@todo - Added documentation here. Back to fjl members list.

fjl.curryN_

@todo - Added documentation here. Back to fjl members list.

fjl.curry_

@todo - Added documentation here. Back to fjl members list.

fjl.cycle

@todo - Added documentation here. Back to fjl members list.

fjl.difference

@todo - Added documentation here. Back to fjl members list.

fjl.drop

@todo - Added documentation here. Back to fjl members list.

fjl.dropWhile

@todo - Added documentation here. Back to fjl members list.

fjl.dropWhileEnd

@todo - Added documentation here. Back to fjl members list.

fjl.elem

@todo - Added documentation here. Back to fjl members list.

fjl.elemIndex

@todo - Added documentation here. Back to fjl members list.

fjl.elemIndices

@todo - Added documentation here. Back to fjl members list.

fjl.filter

@todo - Added documentation here. Back to fjl members list.

fjl.find

@todo - Added documentation here. Back to fjl members list.

fjl.findIndex

@todo - Added documentation here. Back to fjl members list.

fjl.findIndices

@todo - Added documentation here. Back to fjl members list.

fjl.flip

@todo - Added documentation here. Back to fjl members list.

fjl.flipN

@todo - Added documentation here. Back to fjl members list.

fjl.foldl

@todo - Added documentation here. Back to fjl members list.

fjl.foldl1

@todo - Added documentation here. Back to fjl members list.

fjl.foldr

@todo - Added documentation here. Back to fjl members list.

fjl.foldr1

@todo - Added documentation here. Back to fjl members list.

fjl.group

@todo - Added documentation here. Back to fjl members list.

fjl.groupBy

@todo - Added documentation here. Back to fjl members list.

fjl.hasOwnProperty

@todo - Added documentation here. Back to fjl members list.

fjl.head

@todo - Added documentation here. Back to fjl members list.

fjl.id

@todo - Added documentation here. Back to fjl members list.

fjl.init

@todo - Added documentation here. Back to fjl members list.

fjl.inits

@todo - Added documentation here. Back to fjl members list.

fjl.insert

@todo - Added documentation here. Back to fjl members list.

fjl.insertBy

@todo - Added documentation here. Back to fjl members list.

fjl.instanceOf

@todo - Added documentation here. Back to fjl members list.

fjl.intercalate

@todo - Added documentation here. Back to fjl members list.

fjl.intersect

@todo - Added documentation here. Back to fjl members list.

fjl.intersectBy

@todo - Added documentation here. Back to fjl members list.

fjl.intersperse

@todo - Added documentation here. Back to fjl members list.

fjl.isArray

@todo - Added documentation here. Back to fjl members list.

fjl.isBoolean

@todo - Added documentation here. Back to fjl members list.

fjl.isCallable

@todo - Added documentation here. Back to fjl members list.

fjl.isClass

@todo - Added documentation here. Back to fjl members list.

fjl.isEmpty

@todo - Added documentation here. Back to fjl members list.

fjl.isEmptyCollection

@todo - Added documentation here. Back to fjl members list.

fjl.isEmptyList

@todo - Added documentation here. Back to fjl members list.

fjl.isEmptyObject

@todo - Added documentation here. Back to fjl members list.

fjl.isFalsy

@todo - Added documentation here. Back to fjl members list.

fjl.isFunction

@todo - Added documentation here. Back to fjl members list.

fjl.isInfixOf

@todo - Added documentation here. Back to fjl members list.

fjl.isMap

@todo - Added documentation here. Back to fjl members list.

fjl.isNull

@todo - Added documentation here. Back to fjl members list.

fjl.isNumber

@todo - Added documentation here. Back to fjl members list.

fjl.isObject

@todo - Added documentation here. Back to fjl members list.

fjl.isPrefixOf

@todo - Added documentation here. Back to fjl members list.

fjl.isPromise

@todo - Added documentation here. Back to fjl members list.

fjl.isset

@todo - Added documentation here. Back to fjl members list.

fjl.isString

@todo - Added documentation here. Back to fjl members list.

fjl.isSubsequenceOf

@todo - Added documentation here. Back to fjl members list.

fjl.isSuffixOf

@todo - Added documentation here. Back to fjl members list.

fjl.isSymbol

@todo - Added documentation here. Back to fjl members list.

fjl.isTruthy

@todo - Added documentation here. Back to fjl members list.

fjl.isType

@todo - Added documentation here. Back to fjl members list.

fjl.isUndefined

@todo - Added documentation here. Back to fjl members list.

fjl.isUsableImmutablePrimitive

@todo - Added documentation here. Back to fjl members list.

fjl.isWeakMap

@todo - Added documentation here. Back to fjl members list.

fjl.isWeakSet

@todo - Added documentation here. Back to fjl members list.

fjl.iterate

@todo - Added documentation here. Back to fjl members list.

fjl.keys

@todo - Added documentation here. Back to fjl members list.

fjl.last

@todo - Added documentation here. Back to fjl members list.

fjl.length

@todo - Added documentation here. Back to fjl members list.

fjl.lines

@todo - Added documentation here. Back to fjl members list.

fjl.lookup

@todo - Added documentation here. Back to fjl members list.

fjl.map

@todo - Added documentation here. Back to fjl members list.

fjl.mapAccumL

@todo - Added documentation here. Back to fjl members list.

fjl.mapAccumR

@todo - Added documentation here. Back to fjl members list.

fjl.maximum

@todo - Added documentation here. Back to fjl members list.

fjl.maximumBy

@todo - Added documentation here. Back to fjl members list.

fjl.minimum

@todo - Added documentation here. Back to fjl members list.

fjl.minimumBy

@todo - Added documentation here. Back to fjl members list.

fjl.negateF

@todo - Added documentation here. Back to fjl members list.

fjl.negateF3

@todo - Added documentation here. Back to fjl members list.

fjl.negateF4

@todo - Added documentation here. Back to fjl members list.

fjl.negateF5

@todo - Added documentation here. Back to fjl members list.

fjl.negateFMany

@todo - Added documentation here. Back to fjl members list.

fjl.negateP

@todo - Added documentation here. Back to fjl members list.

fjl.notElem

@todo - Added documentation here. Back to fjl members list.

fjl.notEmptyAndOfType

@todo - Added documentation here. Back to fjl members list.

fjl.nub

@todo - Added documentation here. Back to fjl members list.

fjl.nubBy

@todo - Added documentation here. Back to fjl members list.

fjl.objComplement

@todo - Added documentation here. Back to fjl members list.

fjl.objDifference

@todo - Added documentation here. Back to fjl members list.

fjl.objIntersect

@todo - Added documentation here. Back to fjl members list.

fjl.objUnion

@todo - Added documentation here. Back to fjl members list.

fjl.of

@todo - Added documentation here. Back to fjl members list.

fjl.or

@todo - Added documentation here. Back to fjl members list.

fjl.partition

@todo - Added documentation here. Back to fjl members list.

fjl.permutations

Method not implemented yet. @todo - Added documentation here. Back to fjl members list.

fjl.product

@todo - Added documentation here. Back to fjl members list.

fjl.remove

@todo - Added documentation here. Back to fjl members list.

fjl.removeBy

@todo - Added documentation here. Back to fjl members list.

fjl.removeFirstsBy

@todo - Added documentation here. Back to fjl members list.

fjl.repeat

@todo - Added documentation here. Back to fjl members list.

fjl.replicate

@todo - Added documentation here. Back to fjl members list.

fjl.reverse

@todo - Added documentation here. Back to fjl members list.

fjl.scanl

Method not implemented yet. @todo - Added documentation here. Back to fjl members list.

fjl.scanl1

Method not implemented yet. @todo - Added documentation here. Back to fjl members list.

fjl.scanr

Method not implemented yet. @todo - Added documentation here. Back to fjl members list.

fjl.scanr1

Method not implemented yet. @todo - Added documentation here. Back to fjl members list.

fjl.sort

@todo - Added documentation here. Back to fjl members list.

fjl.sortBy

@todo - Added documentation here. Back to fjl members list.

fjl.sortOn

@todo - Added documentation here. Back to fjl members list.

fjl.span

@todo - Added documentation here. Back to fjl members list.

fjl.splitAt

@todo - Added documentation here. Back to fjl members list.

fjl.stripPrefix

@todo - Added documentation here. Back to fjl members list.

fjl.subsequences

@todo - Added documentation here. Back to fjl members list.

fjl.sum

@todo - Added documentation here. Back to fjl members list.

fjl.tail

@todo - Added documentation here. Back to fjl members list.

fjl.tails

@todo - Added documentation here. Back to fjl members list.

fjl.take

@todo - Added documentation here. Back to fjl members list.

fjl.takeWhile

@todo - Added documentation here. Back to fjl members list.

fjl.toString

@todo - Added documentation here. Back to fjl members list.

fjl.transpose

@todo - Added documentation here. Back to fjl members list.

fjl.typeOf

@todo - Added documentation here. Back to fjl members list.

fjl.uncons

@todo - Added documentation here. Back to fjl members list.

fjl.unfoldr

@todo - Added documentation here. Back to fjl members list.

fjl.union

@todo - Added documentation here. Back to fjl members list.

fjl.unionBy

@todo - Added documentation here. Back to fjl members list.

fjl.unlines

@todo - Added documentation here. Back to fjl members list.

fjl.until

@todo - Added documentation here. Back to fjl members list.

fjl.unwords

@todo - Added documentation here. Back to fjl members list.

fjl.unzip

@todo - Added documentation here. Back to fjl members list.

fjl.unzipN

@todo - Added documentation here. Back to fjl members list.

fjl.version

@todo - Added documentation here. Back to fjl members list.

fjl.words

@todo - Added documentation here. Back to fjl members list.

fjl.zip

@todo - Added documentation here. Back to fjl members list.

fjl.zipN

@todo - Added documentation here. Back to fjl members list.

fjl.zipWith

@todo - Added documentation here. Back to fjl members list.

fjl.zipWith3

@todo - Added documentation here. Back to fjl members list.

fjl.zipWith4

@todo - Added documentation here. Back to fjl members list.

fjl.zipWith5

@todo - Added documentation here. Back to fjl members list.

fjl.zipWithN

@todo - Added documentation here. Back to fjl members list.

fjl._all

@todo - Added documentation here. Back to fjl members list.

fjl._and

@todo - Added documentation here. Back to fjl members list.

fjl._any

@todo - Added documentation here. Back to fjl members list.

fjl._append

@todo - Added documentation here. Back to fjl members list.

fjl._appendMany

@todo - Added documentation here. Back to fjl members list.

fjl._at

@todo - Added documentation here. Back to fjl members list.

fjl._breakOnList

@todo - Added documentation here. Back to fjl members list.

fjl._complement

@todo - Added documentation here. Back to fjl members list.

fjl._concat

@todo - Added documentation here. Back to fjl members list.

fjl._concatMap

@todo - Added documentation here. Back to fjl members list.

fjl._cycle

@todo - Added documentation here. Back to fjl members list.

fjl._difference

@todo - Added documentation here. Back to fjl members list.

fjl._drop

@todo - Added documentation here. Back to fjl members list.

fjl._dropWhile

@todo - Added documentation here. Back to fjl members list.

fjl._dropWhileEnd

@todo - Added documentation here. Back to fjl members list.

fjl._elem

@todo - Added documentation here. Back to fjl members list.

fjl._elemIndex

@todo - Added documentation here. Back to fjl members list.

fjl._elemIndices

@todo - Added documentation here. Back to fjl members list.

fjl._filter

@todo - Added documentation here. Back to fjl members list.

fjl._find

@todo - Added documentation here. Back to fjl members list.

fjl._findIndex

@todo - Added documentation here. Back to fjl members list.

fjl._findIndices

@todo - Added documentation here. Back to fjl members list.

fjl._foldl

@todo - Added documentation here. Back to fjl members list.

fjl._foldl1

@todo - Added documentation here. Back to fjl members list.

fjl._foldr

@todo - Added documentation here. Back to fjl members list.

fjl._foldr1

@todo - Added documentation here. Back to fjl members list.

fjl._group

@todo - Added documentation here. Back to fjl members list.

fjl._groupBy

@todo - Added documentation here. Back to fjl members list.

fjl._head

@todo - Added documentation here. Back to fjl members list.

fjl._init

@todo - Added documentation here. Back to fjl members list.

fjl._inits

@todo - Added documentation here. Back to fjl members list.

fjl._insert

@todo - Added documentation here. Back to fjl members list.

fjl._insertBy

@todo - Added documentation here. Back to fjl members list.

fjl._intercalate

@todo - Added documentation here. Back to fjl members list.

fjl._intersect

@todo - Added documentation here. Back to fjl members list.

fjl._intersectBy

@todo - Added documentation here. Back to fjl members list.

fjl._intersperse

@todo - Added documentation here. Back to fjl members list.

fjl._isInfixOf

@todo - Added documentation here. Back to fjl members list.

fjl._isPrefixOf

@todo - Added documentation here. Back to fjl members list.

fjl._isSubsequenceOf

@todo - Added documentation here. Back to fjl members list.

fjl._isSuffixOf

@todo - Added documentation here. Back to fjl members list.

fjl._iterate

@todo - Added documentation here. Back to fjl members list.

fjl._last

@todo - Added documentation here. Back to fjl members list.

fjl._lookup

@todo - Added documentation here. Back to fjl members list.

fjl._map

@todo - Added documentation here. Back to fjl members list.

fjl._mapAccumL

@todo - Added documentation here. Back to fjl members list.

fjl._mapAccumR

@todo - Added documentation here. Back to fjl members list.

fjl._maximum

@todo - Added documentation here. Back to fjl members list.

fjl._maximumBy

@todo - Added documentation here. Back to fjl members list.

fjl._minimum

@todo - Added documentation here. Back to fjl members list.

fjl._minimumBy

@todo - Added documentation here. Back to fjl members list.

fjl._notElem

@todo - Added documentation here. Back to fjl members list.

fjl._nub

@todo - Added documentation here. Back to fjl members list.

fjl._nubBy

@todo - Added documentation here. Back to fjl members list.

fjl._or

@todo - Added documentation here. Back to fjl members list.

fjl._partition

@todo - Added documentation here. Back to fjl members list.

fjl._permutations

@todo - Added documentation here. Back to fjl members list.

fjl._product

@todo - Added documentation here. Back to fjl members list.

fjl._remove

@todo - Added documentation here. Back to fjl members list.

fjl._removeBy

@todo - Added documentation here. Back to fjl members list.

fjl._removeFirstsBy

@todo - Added documentation here. Back to fjl members list.

fjl._repeat

@todo - Added documentation here. Back to fjl members list.

fjl._replicate

@todo - Added documentation here. Back to fjl members list.

fjl._reverse

@todo - Added documentation here. Back to fjl members list.

fjl._sort

@todo - Added documentation here. Back to fjl members list.

fjl._sortBy

@todo - Added documentation here. Back to fjl members list.

fjl._sortOn

@todo - Added documentation here. Back to fjl members list.

fjl._span

@todo - Added documentation here. Back to fjl members list.

fjl._splitAt

@todo - Added documentation here. Back to fjl members list.

fjl._stripPrefix

@todo - Added documentation here. Back to fjl members list.

fjl._subsequences

@todo - Added documentation here. Back to fjl members list.

fjl._sum

@todo - Added documentation here. Back to fjl members list.

fjl._tail

@todo - Added documentation here. Back to fjl members list.

fjl._tails

@todo - Added documentation here. Back to fjl members list.

fjl._take

@todo - Added documentation here. Back to fjl members list.

fjl._takeWhile

@todo - Added documentation here. Back to fjl members list.

fjl._transpose

@todo - Added documentation here. Back to fjl members list.

fjl._uncons

@todo - Added documentation here. Back to fjl members list.

fjl._unfoldr

@todo - Added documentation here. Back to fjl members list.

fjl._union

@todo - Added documentation here. Back to fjl members list.

fjl._unionBy

@todo - Added documentation here. Back to fjl members list.

fjl._unzip

@todo - Added documentation here. Back to fjl members list.

fjl._unzipN

@todo - Added documentation here. Back to fjl members list.

fjl._zip

@todo - Added documentation here. Back to fjl members list.

fjl._zipN

@todo - Added documentation here. Back to fjl members list.

fjl._zipWith

@todo - Added documentation here. Back to fjl members list.

fjl.__

@todo - Added documentation here. Back to fjl members list.

Unit Tests:

To run unit tests:

1.) First do an npm install in project root.

2.) For running tests on './src' with node: Run one of the following from your terminal (from repo root):

  • $ npm test

Requirements:

  • Javascript versions Ecmascript 5+

Supported Platforms:

Browsers

  • IE9+, and all other modern day browsers.

NodeJs

  • 4.0.0+
  • 6.11.x+

License:

GPL v2+ AND MIT

Notes:

  • './.babelrc' is used only for tests. Babel configurations found in './gulpfileConfig.json' are the configurations used for building the project.

Todos:

MVP 1.0.0

  • - Rename pureCurry and pureCurryN to curry and curryN respectively.
  • - Rename old curry{suffix} functions to curry{suffix}_ in lieu of previous change (also since these functions are overloaded and aren't pure curry functions due to their placeholder manipulation feature).
  • - Remove functional operators (zero, alt etc.) out into their own package (?) (tentative).
  • - Make all functional members compatible with es6 classes. No constructors included in library.
  • - Remove use of 'gulp-better-rollup' in favor of using rollup directly.
  • - Re-instate the use of .travisci file when project is passed 'alpha' stage.'
  • - Consider renaming methods/members in the './src/uncurried' package with a prefixed '_'.
  • - Consider renaming './src/uncurried' file names with prefixed '_'.
  • - Move remaining todos to 'issues' tracker.

Keywords

FAQs

Package last updated on 03 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc