Skip to content

Instantly share code, notes, and snippets.

@oisdk oisdk/isPal.hs
Created May 8, 2019

What would you like to do?
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
You can’t perform that action at this time.