Copyright | Copyright (C) 2021 Yoo Chung |
---|---|
License | GPL-3.0-or-later |
Maintainer | dev@chungyc.org |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Part of Ninety-Nine Haskell Problems. Some solutions are in Solutions.P06.
Synopsis
- isPalindrome :: Eq a => [a] -> Bool
Documentation
isPalindrome :: Eq a => [a] -> Bool Source #
Find out whether a list is a palindrome. A palindrome can be read forward or backward; e.g. "xamax".
Examples
>>>
isPalindrome [1,2,3]
False
>>>
isPalindrome "madamimadam"
True
>>>
isPalindrome [1,2,4,8,16,8,4,2,1]
True