Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
<?php declare(strict_types=1); | |
// In reaction to @marcoshuttle's http://marcosh.github.io/post/2017/06/16/maybe-in-php.html | |
// Warning: none of this code has been tested or even run. | |
namespace Verraes\Maybe; | |
interface Just extends Maybe { | |
// We can only extract if we know it's a Just |
<?php | |
foreach (fib() as $x) echo "$x\n"; | |
function fib () { | |
yield 0; yield 1; | |
$f = fib(); $g = fib(); | |
$g->next(); | |
while (true) { | |
yield $f->current() + $g->current(); | |
$f->next(); $g->next(); |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
* | |
!.gitignore |
<?php | |
// Context: I'm trying to argue that DI (and DIC) are great, and DIC libs suck. | |
// Happy to be proven wrong! | |
final class Router { | |
private $dependencies; | |
public function __construct (Dependencies $dependencies) { | |
$this->dependencies = $dependencies; | |
// You might say that this is Service Locator, but it's not. This router is toplevel, | |
// and toplevel must have access to dependencies. After that it can all just bubble nicely using proper DI. |
https://twitter.com/janellekz/status/1183805720225107976?s=20
Well I know Simon's ideas on the matter, that's why I was asking for yours. I haven't given it enough thought to have strong opinions but here's a quick attempt:
Similar: Models and maps both consists of abstractions. The abstractions are chosen, for a purpose, in a context.
Different: Models are conceptual. Models are not just tools for understanding, they are understanding. I can draw or code or somehow express a model, but it's only a representation of an underlying model, not the model itself.
Landscapes and maps are physical. The symbols on the map are linked to things in the landscape. You don't visualize a map, the visualisation is the map.
<?php declare(strict_types=1); | |
/* | |
* This file is part of the Parsica library. | |
* | |
* Copyright (c) 2020 Mathias Verraes <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
My kid 11yo has a blood phobia. I asked Twitter for suggestions for action/adventure/scifi/fantasy/comedy movies that are suitable for a 9 and 11 yo who like Star Wars and Back to the Future.
Below are the movies people have suggested. They often did so from memory, and I haven't validated if they are indeed suitable. However, I learned about this site where you can lookup if a moview has blood or other phobia-inducing content: https://www.doesthedogdie.com/
<?php declare(strict_types=1); | |
// @mathiasverraes | |
// parser is a function that takes some input and returns (either (structured value AND remainder) OR error) | |
// parser is a function that takes some input and returns a Result | |
$a = function ($input) { | |
$parsed = substr($input, 0, 1); | |
$remainder = substr($input, 1); | |
if ($parsed === 'a') return succeed($parsed, $remainder); else return fail("expected a"); | |
}; |