PHPackages                             php-fp/php-fp-io - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. php-fp/php-fp-io

AbandonedArchivedLibrary

php-fp/php-fp-io
================

An implementation of the IO monad in PHP.

813PHP

Since Apr 18Pushed 10y ago1 watchersCompare

[ Source](https://github.com/i-am-tom/php-fp-io)[ Packagist](https://packagist.org/packages/php-fp/php-fp-io)[ RSS](/packages/php-fp-php-fp-io/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

The IO Monad for PHP. [![Build Status](https://camo.githubusercontent.com/07e88a831240c0b00790106f5e4bc4e0796aa9270d12b8a1ed9cb3f93b8df26d/68747470733a2f2f7472617669732d63692e6f72672f7068702d66702f7068702d66702d696f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-fp/php-fp-io)
=====================================================================================================================================================================================================================================================================================================

[](#the-io-monad-for-php-)

*The implementation for this looks more object-oriented than I'd have liked, but it satisfies the monad laws nevertheless.*

Intro
-----

[](#intro)

The IO monad is a concept that exists in functional programming, and was made 'famous' by Haskell. It is a way of purifying IO actions: in essence, this monad provides a method for building a **description** of an impure program, without actually running it.

Typically, when writing functional programs, you would have a main entry point file (e.g. `src/Main.php`) that produces an IO instance. Something like this:

```
