Closed andreasabel closed 2 years ago
undefined in a Show instance, congratulations!
undefined
Show
$ cabal repl ghci> :m +Text.Regex.TDFA.ReadRegex ghci> parseRegex "[[:digit:]]" Right (POr [PConcat [PAny {getDoPa = #1, getPatternSet = "*** Exception: Prelude.undefined CallStack (from HasCallStack): error, called at libraries/base/GHC/Err.hs:74:14 in base:GHC.Err undefined, called at lib/Text/Regex/TDFA/Pattern.hs:110:23 in regex-tdfa-1.3.1.2-inplace:Text.Regex.TDFA.Pattern
https://github.com/haskell-hvr/regex-tdfa/blob/95d47cb982d2cf636b2cb6260a866f9907341c45/lib/Text/Regex/TDFA/Pattern.hs#L98-L110
THOU SHALT NOT ABUSE THE Show CLASS! Show is to print the HASKELL representation of data, not anything nice for the user!
How is one to explore a package if it tampers with Show, esp. in a way that crashes?
undefined
in aShow
instance, congratulations!https://github.com/haskell-hvr/regex-tdfa/blob/95d47cb982d2cf636b2cb6260a866f9907341c45/lib/Text/Regex/TDFA/Pattern.hs#L98-L110
THOU SHALT NOT ABUSE THE
Show
CLASS!Show
is to print the HASKELL representation of data, not anything nice for the user!How is one to explore a package if it tampers with
Show
, esp. in a way that crashes?