widmogrod/php-functional

View on GitHub
src/Primitive/Listt.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

declare(strict_types=1);

namespace Widmogrod\Primitive;

use Widmogrod\Common;
use FunctionalPHP\FantasyLand;

/**
 * data List a = Nil | Cons a (List a)
 */
interface Listt extends
    FantasyLand\Monad,
    FantasyLand\Monoid,
    FantasyLand\Setoid,
    FantasyLand\Foldable,
    FantasyLand\Traversable,
    Common\ValueOfInterface
{
    /**
     * head :: [a] -> a
     *
     * @return mixed First element of Listt
     *
     * @throws EmptyListError
     */
    public function head();

    /**
     * tail :: [a] -> [a]
     *
     * @return \Widmogrod\Primitive\Listt
     *
     * @throws EmptyListError
     */
    public function tail(): self;
}