Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

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