Closed
Description
undefined
in a Show
instance, congratulations!
$ 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
regex-tdfa/lib/Text/Regex/TDFA/Pattern.hs
Lines 98 to 110 in 95d47cb
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?