addEPDefValToSig :: Sign -> Token -> APInt -> Sign
addEPDefValToSig sig tok i
    | mD == Nothing = error $ "addEPDefValToSig: The extended parameter"
                      ++ " declaration for " ++ show tok ++ " is missing"
    | otherwise = sig {epdecls = ed'}
    where (mD, ed') = Map.insertLookupWithKey f tok err $ epdecls sig
          err = error "addEPDefValToSig: dummyval"
          f _ _ (EPDecl _ dom Nothing) = EPDecl tok dom $ Just i
          f _ _ (EPDecl _ _ (Just j)) =
              error $ "addEPDefValToSig: default value already set to "
                        ++ show j
addEPDefValToSig :: Sign -> Token -> APInt -> Sign
addEPDefValToSig sig tok i
    | mD == Nothing = error $ "addEPDefValToSig: The extended parameter"
                      ++ " declaration for " ++ show tok ++ " is missing"
    | otherwise = sig {epdecls = ed'}
    where (mD, ed') = Map.insertLookupWithKey f tok err $ epdecls sig
          err = error "addEPDefValToSig: dummyval"
          f _ _ (EPDecl _ dom Nothing) = EPDecl tok dom $ Just i
          f _ _ (EPDecl _ _ (Just j)) =
              error $ "addEPDefValToSig: default value already set to "
                        ++ show j
addEPDefValToSig sig tok i
    | mD == Nothing = error $ "addEPDefValToSig: The extended parameter"
                      ++ " declaration for " ++ show tok ++ " is missing"
    | otherwise = sig {epdecls = ed'}
    where (mD, ed') = Map.insertLookupWithKey f tok err $ epdecls sig
          err = error "addEPDefValToSig: dummyval"
          f _ _ (EPDecl _ dom Nothing) = EPDecl tok dom $ Just i
          f _ _ (EPDecl _ _ (Just j)) =
              error $ "addEPDefValToSig: default value already set to "
                        ++ show j