ABC words: Difference between revisions

Updated Haskell version
(→‎{{header|Diego}}: Added Diego entry)
(Updated Haskell version)
Line 1,582:
 
=={{header|Haskell}}==
<lang haskell>import Data.MaybeBool (isJustbool)
import Data.Maybe (isJust)
 
------------------------ ABC WORDS -----------------------
Line 1,589 ⟶ 1,590:
isABC s =
isJust $
afterCharresidue 'a' "bc" s
>>= afterCharresidue 'b' "c"
>>= afterChar(bool Nothing . Just) <*> ('c' ""`elem`)
 
afterCharresidue :: Char -> String -> String -> Maybe String
afterCharresidue c except = go
where
go [] = Nothing
9,655

edits