Skip to content

nicl/functional-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 28, 2012
c78b6f2 · Nov 28, 2012

History

19 Commits
Nov 28, 2012
Nov 28, 2012
Nov 24, 2012
Nov 26, 2012
Nov 28, 2012
Nov 26, 2012
Nov 24, 2012

Repository files navigation

functional-php

success-kid-php

A collection of utility functions, inspired (mostly) by Clojure. A few are simply wrappers around existing PHP functions. For the most part, however, they offer something new. Some functions which appear familiar add value by accepting a variable number of arguments (for example, max, or merge).

Functions included

Note, none of this is fully decided yet; more functions may be included, others may be removed. Nobody knows what's going to happen - it's crazy!!!

  • and_all
  • apply
  • assoc
  • comp
  • compare
  • complement
  • concat
  • contains
  • dissoc
  • distinct
  • drop
  • every
  • every_pred
  • filter
  • flatten
  • group_by
  • interleave
  • interpose
  • iterate
  • keep
  • map
  • mapcat
  • map_indexed
  • max
  • memoize
  • merge
  • merge_with
  • min
  • nth
  • partial
  • partition
  • partition_all
  • partition_by
  • reduce
  • reify (?)
  • rem
  • reverse
  • set
  • some
  • split_at
  • split_with
  • take
  • take_last
  • take_nth
  • take_while
  • unless
  • update_in
  • zipmap

Tests

Functional-PHP needs better tests! All pull requests to improve or add new tests are welcome.

If you wish to run the tests you need to have PHPUnit installed. Then, from the functional-php root directory run:

phpunit

(You may need to adapt the phpunit command and paths depending on your configuration.)

About

a collection of composable functions inspired by Clojure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages