Created
May 8, 2019 00:13
-
-
Save oisdk/4b7f304c9a9273b07f227f63fd896231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isPal :: forall a. Eq a => [a] -> Bool | |
isPal xs = getAll (fst (go xs xs)) where | |
go (y:ys) (_:_:zs) = f y =<< go ys zs | |
go (_:ys) [_] = pure ys | |
go ys [] = pure ys | |
f y ~(z:zs) = (All (y == z), zs) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment