tail :: NonEmpty a -> [a]but it was given a more complex type to provide friendlier compile time errors.
>>> tail ('a' :| "bcde") "bcde" >>> tail [0..5 :: Int] ... ... 'tail' works with 'NonEmpty', not ordinary lists. Possible fix: Replace: [Int] With: NonEmpty Int ... However, you can use 'tail' with the ordinary lists. Apply 'viaNonEmpty' function from relude: viaNonEmpty tail (yourList) Note, that this will return 'Maybe [Int]' therefore it is a safe function unlike 'tail' from the standard Prelude ... >>> tail (Just 'a') ... ... 'tail' works with 'NonEmpty Char' lists But given: Maybe Char ...
>>> tail [1, 2, 3] [2,3]
>>> tail [1] []
>>> tail [] *** Exception: Prelude.tail: empty list
>>> tails undefined [*** Exception: Prelude.undefined
>>> drop 1 (tails [undefined, 1, 2]) [[1, 2], [2], []]
>>> tails "abc" ["abc","bc","c",""]
>>> tails [1, 2, 3] [[1,2,3],[2,3],[3],[]]
>>> tails [] [[]]