[Haskell-cafe] out-commented code vs. case with redundant pattern matches

Henning Thielemann lemming at henning-thielemann.de
Thu Nov 30 09:28:52 UTC 2017


On Wed, 29 Nov 2017, Sergiu Ivanov wrote:

> Thus quoth  Henning Thielemann  on Wed Nov 29 2017 at 11:04 (+0100):
>> Occasionally I have multiple implementations of the same task and want to
>> choose one quickly but statically. I do not want to out-comment unused
>> branches because they shall still be type checked. So far I used this
>> scheme:
>>
>>     case 0::Int of
>>        0 -> putStrLn "A"
>>        1 -> putStrLn "B"
>>        _ -> putStrLn "C"

I have filed a GHC ticket:
    https://ghc.haskell.org/trac/ghc/ticket/14546


More information about the Haskell-Cafe mailing list