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

Provide a collection of Predicate functions #26

Merged
merged 1 commit into from
Jan 14, 2017
Merged

Provide a collection of Predicate functions #26

merged 1 commit into from
Jan 14, 2017

Conversation

evilsoft
Copy link
Owner

Maximum exposure

This PR addresses issue#21 and exposes all the internal predicate functions to the outside world. The following have be added to the public API and moved from the internal folder and into a new predicates folder:

  • isApplicative
  • isApply
  • isArray
  • isEmpty
  • isFunction
  • isFunctor
  • isMonoid
  • isNil
  • isNumber
  • isObject
  • isSemigroup
  • isString

In addition to these existing functions, some new ones have been added, just to flesh them out a bit more:

  • isBoolean
  • isInteger
  • isMonad
  • isSetoid
  • isTraversable

Also as a 🍠 Bonus I add a not function that takes a predicate function and returns a new predicate function that will negate the result of the passed function.

const { not, isNil, safe } = crocks

const f =
  safe(not(isNil))

f(undefined) // Maybe.Nothing
f(23) // Maybe.Just 23

@evilsoft
Copy link
Owner Author

@evilsoft evilsoft merged commit 9648adf into master Jan 14, 2017
@evilsoft evilsoft deleted the preds branch January 14, 2017 00:55
@evilsoft evilsoft added this to the v0.2.0 milestone Jan 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant