[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]If the first list is not finite, the result is the first list.
>>> [1, 2, 3] ++ [4, 5, 6] [1,2,3,4,5,6]
>>> [] ++ [1, 2, 3] [1,2,3]
>>> [3, 2, 1] ++ [] [3,2,1]
tailDef [12] [] = [12] tailDef [12] [1,3,4] = [3,4]
[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]If the first list is not finite, the result is the first list. WARNING: This function takes linear time in the number of elements of the first list.
>>> shorterList (shorterList (repeat 'a') (repeat 'b')) "abc" "abc"The trick is, that the skeleton of the resulting list is constructed using zipWith without touching the elements. The contents is then computed (only) if requested.
[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]If the first list is not finite, the result is the first list.
[x,y,z,...] +| [a,b,c,...] = [x,a,y,b,z,c,...]
\(Shape xs) (List ys) -> Match.take xs ys == List.take (length xs) ys
\(Shape xs) (List ys) -> Match.drop xs ys == List.drop (length xs) ys
\(Shape xs) (List ys) -> Match.take xs ys ++ Match.drop xs ys == ys
\(Shape xs) (List ys) -> Match.takeRev xs ys == reverse (Match.take xs (reverse ys))
\(Shape xs) (List ys) -> Match.dropRev xs ys == reverse (Match.drop xs (reverse ys))
waitUntil 5 (getText <=< findElem $ ByCSS ".class") `onTimeout` return ""