Skip to content

Commit 2dbb271

Browse files
authored
Merge pull request #117 from haeber/master
remove composer.lock (see issue #116) & fix some typos
2 parents 4e4155e + 11e4c51 commit 2dbb271

File tree

3 files changed

+27
-4310
lines changed

3 files changed

+27
-4310
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ vendor/
22
.idea
33
.php_cs.cache
44
.phpunit.cache
5+
/composer.lock

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ The purpose of this library is to explore `Functors`, `Applicative Functors`
99
and `Monads` in OOP PHP, and provide examples of real world use case.
1010

1111
Monad types available in the project:
12-
* `State Monad`
13-
* `IO Monad`
14-
* `Free Monad`
15-
* `Either Monad`
16-
* `Maybe Monad`
17-
* `Reader Monad`
18-
* `Writer Monad`
12+
* `State Monad`
13+
* `IO Monad`
14+
* `Free Monad`
15+
* `Either Monad`
16+
* `Maybe Monad`
17+
* `Reader Monad`
18+
* `Writer Monad`
1919

2020
Exploring functional programing space I noticed that working with primitive values from PHP
2121
is very hard and complicates implementation of many functional structures.
2222
To simplify this experience, set of higher order primitives is introduced in library:
23-
* `Num`
24-
* `Sum`
25-
* `Product`
26-
* `Stringg`
27-
* `Listt` (a.k.a List Monad, since `list` is a protected keyword in PHP)
23+
* `Num`
24+
* `Sum`
25+
* `Product`
26+
* `Stringg`
27+
* `Listt` (a.k.a. List Monad, since `list` is a protected keyword in PHP)
2828

2929
## Applications
3030
Known applications of this project
@@ -240,9 +240,9 @@ assert($r->runReader('World') === 'HELLO GILLES! HOW ARE YOU?')
240240

241241
### Free Monad in PHP
242242
Imagine that you first write business logic and don't care about implementation details like:
243-
- how and from where get user discounts
244-
- how and where save products in basket
245-
- and more ...
243+
* how and where to get user discounts
244+
* how and where to save products in the basket
245+
* and more...
246246

247247
When your business logic is complete, then you can concentrate on those details.
248248

@@ -314,8 +314,8 @@ $this->assertEquals(
314314
## Haskell `do notation` in PHP
315315
Why Haskell's do notation is interesting?
316316

317-
In Haskell is just an "syntax sugar" and in many ways is not needed,
318-
but in PHP control flow of monads can be hard to track.
317+
In Haskell it's just syntactic sugar and, in many ways, isn't needed,
318+
but in PHP, the control flow of monads can be hard to track.
319319

320320
Consider example, that use only chaining `bind()`
321321
and compare it to the same version but with `do notation` in PHP.
@@ -364,12 +364,12 @@ In recently published book [`Functional PHP` by Gilles Crettenand](https://www.
364364

365365
## References
366366
Here links to their articles`/`libraries that help me understood the domain:
367-
* http://drboolean.gitbooks.io/mostly-adequate-guide
368-
* https://github.com/fantasyland/fantasy-land
369-
* http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html
370-
* http://learnyouahaskell.com/functors-applicative-functors-and-monoids
371-
* http://learnyouahaskell.com/starting-out#im-a-list-comprehension
372-
* http://robotlolita.me/2013/12/08/a-monad-in-practicality-first-class-failures.html
373-
* http://robotlolita.me/2014/03/20/a-monad-in-practicality-controlling-time.html
374-
* https://github.com/folktale/data.either
375-
* https://github.com/widmogrod/php-algorithm-w
367+
* [Mostly Adequate Guide](http://drboolean.gitbooks.io/mostly-adequate-guide)
368+
* [Fantasy Land](https://github.com/fantasyland/fantasy-land)
369+
* [Functors, Applicatives, and Monads in Pictures](http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html)
370+
* [LYAH: Functors, Applicative Functors, and Monoids](http://learnyouahaskell.com/functors-applicative-functors-and-monoids)
371+
* [LYAH: List Comprehension](http://learnyouahaskell.com/starting-out#im-a-list-comprehension)
372+
* [A Monad in Practicality: First-Class Failures](http://robotlolita.me/2013/12/08/a-monad-in-practicality-first-class-failures.html)
373+
* [A Monad in Practicality: Controlling Time](http://robotlolita.me/2014/03/20/a-monad-in-practicality-controlling-time.html)
374+
* [folktale/data.either](https://github.com/folktale/data.either)
375+
* [widmogrod/php-algorithm-w](https://github.com/widmogrod/php-algorithm-w)

0 commit comments

Comments
 (0)