[Haskell-cafe] "shadowing" keywords like "otherwise"

Janis Voigtlaender voigt at tcs.inf.tu-dresden.de
Sun Jun 28 03:47:09 EDT 2009


Vasili I. Galchin wrote:
> so Janis I have to look where the original author overrode "otherwise"? 
> If so, just great .. a ton of code. ;^(

No, you don't have to look for this. It is in the code snippet you sent:

swishParse :: String -> String -> SwishStateIO (Maybe RDFGraph)
swishParse fnam inp =
     do  { fmt <- gets $ format
         ; case fmt of
             N3        -> swishParseN3 fnam inp
             otherwise ->
                 do  { swishError ("Unsupported file format: "++(show
fmt)) 4
                     ; return Nothing
                     }
         }

In the case expression you use "otherwise" as a variable. But you do not
use that variable in that branch. Hence the warning:

Swish/HaskellRDF/SwishCommands.hs:304:12:
     Warning: Defined but not used: `otherwise'

This has nothing to do with someone else shadowing the definition of
"otherwise".

Ciao,
Janis.

-- 
Dr. Janis Voigtlaender
http://wwwtcs.inf.tu-dresden.de/~voigt/
mailto:voigt at tcs.inf.tu-dresden.de



More information about the Haskell-Cafe mailing list