PXJLVN77FE6X3RAQBMZTBRRIWTOA2XT7ESYUTHLUCA73DB2WJOMAC
defp identity(line) do
{line, &identity/1}
defp skip_until(predicate, next) do
fn l ->
if predicate.(l) do
{nil, next}
else
{nil, skip_until(predicate, next)}
end
end
end
defp skip_lines(n, next) do
fn _ ->
if n == 0 do
{nil, next}
else
{nil, skip_lines(n - 1, next)}
end
end
end
defp keep_until(predicate) do
fn line ->
if predicate.(line) do
{nil, nil}
else
{{:line, line}, keep_until(predicate)}
end
end