Skip to content

Instantly share code, notes, and snippets.

@datashaman
Last active May 8, 2019 05:07
Show Gist options
  • Select an option

  • Save datashaman/3cf16096f1c5f651c88d82dd608171eb to your computer and use it in GitHub Desktop.

Select an option

Save datashaman/3cf16096f1c5f651c88d82dd608171eb to your computer and use it in GitHub Desktop.
Datashaman\Logic\lefts Example
<?php
<<<CONFIG
packages:
- "datashaman/logic: dev-master"
CONFIG;
#
# This is a Melody script. http://melody.sensiolabs.org/
#
use function Datashaman\Logic\lefts;
use function Datashaman\Logic\mkLeft;
use function Datashaman\Logic\mkRight;
use function Datashaman\Logic\repr;
$es = [mkLeft('ERR'), mkRight('OK'), mkRight('OK Too'), mkLeft('ERR 13')];
echo repr(lefts($es)) . PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment