Пример #1
0
 /**
  * @dataProvider provideFunctions
  */
 public function test_it_should_curry_if_not_enough_args_passed(callable $func, array $args, $expected)
 {
     $flipped = f\flip($func);
     $x = f\head($args);
     $xs = f\tail($args);
     $curried = $flipped($x);
     $this->assertEquals($expected, call_user_func_array($curried, $xs));
 }
Пример #2
0
/**
 * getLine :: IO String
 *
 * @throws IOError
 *
 * @return M\IO
 */
function getLine()
{
    return until(f\eql("\n"), f\flip(f\concatStrings), '', getChar());
}