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

Olaf Klinke olf at aatal-apotheke.de
Wed Nov 29 18:32:32 UTC 2017


Henning, 

how about putting the branches into their own variables. Admittedly this pollutes the namespace but is much more readable IMHO. 

workflow = new_workflow where
  new_workflow = putStrLn "A"
  old_workflow = putStrLn "B"

I suppose GHC complains neither about unused where clauses nor about unused top-level bindings. At least with GHCi 7.8.3 the above code produces no warnings. 

Olaf


More information about the Haskell-Cafe mailing list