I have this List oX of (Char, Int) pars (it contains pairs with only unique Char values)
List(( ,3), (d,1), (e,3), (h,3), (i,1) , (l,3), (o,2), (r,2), (t,1),
From the documentation of span
: "Returns the longest prefix of the list whose elements all satisfy the given predicate, and the rest of the list."
So here span
gives you the expected result: since the first tuple in your list doesn't have the character d
, the longest prefix of the list where each tuple has the character d
is indeed the empty list.