CheckList.hs
isListOrFirstEmpty :: [[a]] -> Bool isListOrFirstEmpty xs = if (null xs) then True else if (null (head xs)) then True else False
*Main> :load CheckList.hs [1 of 1] Compiling Main ( CheckList.hs, interpreted ) Ok, modules loaded: Main. *Main> *Main> isListOrFirstEmpty [] True *Main> isListOrFirstEmpty ["abc", ""] False *Main> isListOrFirstEmpty ["", "abc"] True
No comments:
Post a Comment