FunctionalPerl
view release on metacpan or search on metacpan
chance of being up to date), and is aiming to give a pretty
comprehensive overview which doesn't require you to read the other
docs first. Some of the info here is duplicated (in more detail)
in the other documents. If this is too long, take a look at the
presentation below or the example scripts.
* [__Presentation__](http://functional-perl.org/london.pm-talk/)
These are the slides of an introductory presentation, but there's
no recording and the slides may not be saying enough for
understanding. It's also somewhat outdated.
* [__Intro directory__](intro/)
The `intro` directory contains scripts introducing the concepts,
including the basics of functional programming (work in
progress). The scripts are meant to be viewed in this order:
1. [basics](intro/basics)
1. [tailcalls](intro/tailcalls)
1. [more_tailcalls](intro/more_tailcalls)
This doesn't go very far yet (todo: add more). Also, please note
that `Sub::Call::Tail` is currently broken with newer Perl
versions (todo: look into fixing it or whether it is possible to
imlement it in a simpler manner).
* [__Examples__](examples/README.md)
The `examples` directory contains scripts showing off the
possibilities. You will probably not understand everything just
from looking at these, but they will give an impression.
* __Our howto and design documents__
* *[How to write functional programs in Perl 5](docs/howto.md)* is
describing the necessary techniques to use the functional style in
Perl. (Todo: this may be too difficult for someone who doesn't know
anything about functional programming; what to do about it?)
* *[The design principles used in the functional-perl
library](docs/design.md)* is describing the organization and ideas
behind the code that the functional-perl project offers.
* __Book__
If you need a more gentle introduction into the ideas behind
functional programming, you may find it in *[Higher-Order
Perl](http://hop.perl.plover.com/)* by Mark Jason Dominus. This book
was written long before the functional-perl project was started, and
does various details differently.
Please ask [me](http://leafpair.com/contact) if you'd like to meet up
in London, Berlin or Switzerland to get an introduction in person.
## Dependencies
* to use `bin/perlrepl`, `bin/fperl` or the repl in the intro and
examples scripts interactively, `Term::ReadLine::Gnu` and
`PadWalker` (and optionally `Eval::WithLexicals` if you want to use
the :m/:M modes, and `Capture::Tiny` to see code definition location
information and `Sub::Util` from `Scalar::List::Utils` to see
function names when displaying code refs.)
* to run the test suite: `Test::Requires`
* to run all the tests (otherwise some are skipped): in addition to
the above, Perl version >= 5.020, `Test::Pod::Snippets`,
`BSD::Resource`, `Method::Signatures`, `Sub::Call::Tail`,
`Text::CSV`, `DBD::CSV`, `Text::CSV`, `URI`, `Text::Markdown`,
`Clone`. Some of these are also necessary to run `htmlgen/gen` (or
`website/gen` to build the website), see
[Htmlgen](htmlgen/README.md) for details.
* some examples also use: `JSON`
(Todo: should all of the above be listed in PREREQ_PM in Makefile.PL?)
You can run `meta/install-development-dependencies-on-debian` to get
those installed if you're on a Debian system.
## Installation
### From CPAN
Use your preferred CPAN installer, for example: `cpan
FunctionalPerl`. Note that this one installs the "runtime recommends"
dependencies as well, which is a lot (like e.g. DBI), so you may want
to look through the `Makefile.PL` or the list below and install what
you can from your Linux distribution or other binary package
repository first. Or if you don't want the recommends, set
`recommends_policy` in `$ENV{HOME}/.cpan/CPAN/MyConfig.pm` to 0, or
install the cpanminus tool and run `cpanm FunctionalPerl` which skips
recommends unless you pass the `--with-recommends` option.
### From the Git repository
git clone https://github.com/pflanze/functional-perl.git
cd functional-perl
# to get the latest release, which is $FP_COMMITS_DIFFERENCE behind master:
git checkout -b $FP_VERSION_UNDERSCORES $FP_VERSION
# to verify the same against MitM attacks:
gpg --recv-key 04EDB072
git tag -v $FP_VERSION
# You'll find various pages in search engines with my fingerprint,
# or you may find a trust path through one of the signatures on my
# older key 1FE692DA, that this one is signed with.
The bundled scripts modify the library load path to find the files
locally, thus no installation is necessary. All modules are in the
`lib/` directory, `export PERL5LIB=path/to/functional-perl/lib` is all
that's needed.
To install, run the usual `perl Makefile.PL; make test && make install`.
(The repository might be split into producing several separate CPAN
packages (or even repositories?) in the future, thus don't rely too
( run in 1.716 second using v1.01-cache-2.11-cpan-39bf76dae61 )