Predicate Functions
All functions in this group have a signature of * -> Boolean and are used with
the many predicate based functions that ship with crocks,
like safe, ifElse and filter to name a few. They also
fit naturally with the Pred ADT. All predicate functions can be referenced
from crocks/predicates.
Below is a list of all the current predicates that are included with a description of their truth:
hasProp :: (String | Integer) -> a -> Boolean: anArrayorObjectthat contains the provided index or keyhasProps :: Foldable f => f (String | Integer) -> a -> Boolean: anArrayorObjectthat contains the provided indexs or keyshasPropPath :: [ String | Integer ] -> a -> Boolean: anArrayorObjectthat contains the provided index pathisAlt :: a -> Boolean: an ADT that providesmapandaltmethodsisAlternative :: a -> Boolean: an ADT that providesalt,zero,map,ap,chainandofmethodsisApplicative :: a -> Boolean: an ADT that providesmap,apandofmethodsisApply :: a -> Boolean: an ADT that providesmapandapmethodsisArray :: a -> Boolean: ArrayisBifunctor :: a -> Boolean: an ADT that providesmapandbimapmethodsisBoolean :: a -> Boolean: BooleanisCategory :: a -> Boolean: an ADT that providesidandcomposemethodsisChain :: a -> Boolean: an ADT that providesmap,apandchainmethodsisContravariant :: a -> Boolean: an ADT that providescontramapmethodisDate :: a -> Boolean: DateisDefined :: a -> Boolean: Every value that is notundefined,nullincludedisEmpty :: a -> Boolean: Empty Monoid, Object, Array, String, undefined, null, all Numbers and Boolean valuesisExtend :: a -> Boolean: an ADT that providesmapandextendmethodsisFalse :: a -> Boolean: a value that is strictly equal tofalseisFalsy :: a -> Boolean: a value that is considered to befalsyisFoldable :: a -> Boolean: Array, List or any structure with areducemethodisFunction :: a -> Boolean: FunctionisFunctor :: a -> Boolean: an ADT that provides amapmethodisInteger :: a -> Boolean: IntegerisIterable :: a -> Boolean: anObjectwith aniteratormethodisMap :: a -> Boolean: MapisMonad :: a -> Boolean: an ADT that providesmap,ap,chainandofmethodsisMonoid :: a -> Boolean: an ADT that providesconcatandemptymethodsisNil :: a -> Boolean:undefinedornullorNaNisNumber :: a -> Boolean:Numberthat is not aNaNvalue,InfinityincludedisObject :: a -> Boolean: Plain Old JavaScript Object (POJO)isPlus :: a -> Boolean: an ADT that providesmap,altandzeromethodsisProfunctor :: a -> Boolean: an ADT that providesmap,contramapandpromapmethodsisPromise :: a -> Boolean: an object implementingthenandcatchisSame :: a -> b -> Boolean: same value or reference, useequalsfor value equalityisSameType :: a -> b -> Boolean: Constructor matches a values type, or two values types matchisSemigroup :: a -> Boolean: an ADT that provides aconcatmethodisSemigroupoid :: a -> Boolean: an ADT that provides acomposemethodisSetoid :: a -> Boolean: an ADT that provides anequalsmethodisString :: a -> Boolean: StringisSymbol :: a -> Boolean: SymbolisTraversable :: a -> Boolean: an ADT that providesmapandtraversemethodsisTrue :: a -> Boolean: a value that is strictly equal totrueisTruthy :: a -> Boolean: a value that is considered to betruthypathEq :: [ String | Integer ] -> a -> Object -> Boolean: anObjectthat contains the provided key in the traversal path, with a value equal to the provided value. (equality by value)pathSatisfies :: [ String | Integer ] -> ((a -> Boolean) | Pred) -> Object -> Boolean: anObjectthat contains the provided key in the traversal path with a value that passes the provided predicate.propEq :: (String | Integer) -> a -> Object -> Boolean: anObjectthat contains the provided key with a value equal to the provided value. (equality by value)propSatisfies :: (String | Integer) -> ((a -> Boolean) | Pred) -> Object -> Boolean: anObjectthat contains the provided key with a value that passes the provided predicate.