addScope :: forall t . Typeable t => String -> Value t -> Action ()
addScope name v = Action $
    modify $ \s -> let now:rest = scopes s in
                   if name `elem` map fst now
                   then error $ "Defined twice in one scope, " ++ name
                   else s{scopes=((name,(typeOf (undefined :: t), fromValue v)):now):rest}
addScope :: forall t . Typeable t => String -> Value t -> Action ()
addScope name v = Action $
    modify $ \s -> let now:rest = scopes s in
                   if name `elem` map fst now
                   then error $ "Defined twice in one scope, " ++ name
                   else s{scopes=((name,(typeOf (undefined :: t), fromValue v)):now):rest}
addScope name v = Action $
    modify $ \s -> let now:rest = scopes s in
                   if name `elem` map fst now
                   then error $ "Defined twice in one scope, " ++ name
                   else s{scopes=((name,(typeOf (undefined :: t), fromValue v)):now):rest}