listUtil.hs
checkList :: [Integer] -> Bool checkList (5:xs) = True checkList xs = False
*Main> :load listUtil.hs [1 of 1] Compiling Main ( listUtil.hs, interpreted ) Ok, modules loaded: Main. *Main> *Main> *Main> checkList [] False *Main> *Main> checkList [2, 3] False *Main> *Main> checkList [5, 2, 3] True *Main> *Main> checkList [5] True *Main>
No comments:
Post a Comment