up-to-date-real-world-haskell
up-to-date-real-world-haskell copied to clipboard
Some Problems in Chapter 14
trafficstars
I follow the codes in chapter 14 and find some little problems.
charClass_wordydefined but not used, I think maybe thecharClassfunction should be modified as following:
charClass (']':cs) = (']':) <$> globToRegex' cs
charClass (c:cs) = (c:) <$> charClass_wordy cs
-
According to monad fail, from GHC 8.8+, the
failfunction will not be supported. I suggest change thefailfunction toerroror other implementation. -
charClass_wordy also lacks a matching form, which should be added as follows:
charClassWordy "" =
error "No more input"