| reversel :: | |
| [a] | |
| -> [a] | |
| reversel xs = | |
| let go (_:xs) ~(y:ys) = | |
| y : go xs ys | |
| go [] ~[] = | |
| [] | |
| in go xs (reverse xs) | |
| r :: | |
| Int | |
| -> [a] | |
| -> Int | |
| r n = | |
| length . take n . reversel . reversel | |
| -- > r 1223 ['a'..] | |
| -- 1223 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment