
You can still turn off Typeable deriving altogether, I believe. That'll
only cause trouble if you're using Typeable.
On Sun, Sep 19, 2021, 11:24 AM Brandon Allbery
Hm. Then I bet that's the implicit Typeable derivation and there's nothing to be done about it because it's used internally.
On Sun, Sep 19, 2021 at 10:58 AM Viktor Dukhovni
wrote: On Sun, Sep 19, 2021 at 07:58:22AM -0400, Brandon Allbery wrote:
On Sun, Sep 19, 2021 at 3:02 AM Viktor Dukhovni
wrote:
I don't know how to suppress unexported constructor names appearing in the compiled code, perhaps someone else does, or it might not be possible...
I would ask if there's a "deriving Show" involved.
My test code does not.
$ rm foo.o foo.hi $ ghc -fhide-source-paths -dno-typeable-binds -dsuppress-type-signatures -optl-s -O2 foo.hs [1 of 1] Compiling Main Linking foo ... $ strings -a foo | grep -i secret main:Main.AnotherSecret
$ cat foo.hs module Main (main) where
import System.Environment import Data.Maybe
data SecretName = AnotherSecret String Int
secretName :: [String] -> Maybe SecretName secretName = fmap (AnotherSecret <$> id <*> (+ 42) . read) . listToMaybe {-# NOINLINE secretName #-}
main :: IO () main = secretName <$> getArgs >>= mapM_ (\ (AnotherSecret a b) -> print (a, b))
With a deriving (Show) instance, I see a second occurence:
main:Main.AnotherSecret AnotherSecret
-- Viktor. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- brandon s allbery kf8nh allbery.b@gmail.com _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.