Skip to content

Instantly share code, notes, and snippets.

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