Code Duplication    Length = 4-4 lines in 2 locations

src/list.php 2 locations

@@ 206-209 (lines=4) @@
203
function init () {
204
    static $init = false;
205
    $init = $init ?: curry(function($list) {
206
        if(is_string($list))
207
            return (strlen($list) > 1)
208
                ? substr($list, 0, strlen($list) - 1)
209
                : '';
210
        return (count($list) > 1)
211
            ? array_slice($list, 0, count($list) - 1)
212
            : [];
@@ 237-240 (lines=4) @@
234
function tail () {
235
    static $tail = false;
236
    $tail = $tail ?: curry(function($list) {
237
        if(is_string($list))
238
            return (strlen($list) > 1)
239
                ? substr($list, 1)
240
                : '';
241
        return (count($list) > 1)
242
            ? array_slice($list, 1)
243
            : [];