FunctionalExtras Documentation
FunctionalExtras Documentation
http://web.mit.edu/~gasc/www/software
Rationale
ÿ I often find that Mathematica is missing simple functions that I want. These are some of those.
Installation
Use
Included Functions
ì Inc[x]
Returns x plus one. Different from Increment because it does not modify x.
ì Dec[x]
Returns x minus one. Different from Decrement because it does not modify x.
ì Output[x]
Prints x and returns x. Different from Print because it returns x. Useful for debugging.
ì EveryQ[list, pred]
EveryQ[list, pred]
Returns True if pred is true of every element in list. Otherwise returns False.
ì NotEveryQ[list, pred]
Returns True if pred is not true of every element in list, i.e. it is false of any element. Otherwise
returns False.
ì AnyQ[list, pred]
Returns True if pred is true of any element in list. Otherwise returns False.
ì NotAnyQ[list, pred]
ì Some[list, pred]
Returns the first element in list for which pred is true. Returns False if there is no such element.
ì FoldAll[f, list]
Folds (reduces) f over list, returning the result. Same as Fold[f, First[list], Rest[list]].
ì FoldAllList[f, list]
Folds (reduces) f over list, returning the list of all intermediate results. Same as FoldAll[f, First[list],
Rest[list]].
ì Negation[f]
Returns a function taking the same arguments as f but returning the opposite truth value.
License
Contributions
ÿ Are welcome.
Author
ì
Author
ÿ Garth Sheldon-Coulson
http://web.mit.edu/~gasc/www
gasc ΑΤ mit ∆ΟΤ edu