Skip to content

Instantly share code, notes, and snippets.

@datashaman
Last active May 8, 2019 05:07
Show Gist options
  • Save datashaman/23c511a38a2d506e6d89313025b77d0c to your computer and use it in GitHub Desktop.
Save datashaman/23c511a38a2d506e6d89313025b77d0c to your computer and use it in GitHub Desktop.
Datashaman\Logic\catMaybes Example
<?php
<<<CONFIG
packages:
- "datashaman/logic: dev-master"
CONFIG;
#
# This is a Melody script. http://melody.sensiolabs.org/
#
use function Datashaman\Logic\catMaybes;
use function Datashaman\Logic\mkMaybe;
use function Datashaman\Logic\repr;
$ms = [mkMaybe(null), mkMaybe(12), mkMaybe(23), mkMaybe(null), mkMaybe(null)];
echo repr(catMaybes($ms)) . PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment