-- | store a user, updating it if told so
packUser :: Bool -> InternalUser -> Update Morgue InternalUser
packUser update user = do
    morgue <- get
    put $ morgue { allUsers = func user (allUsers morgue) }
    return user
    where func | update = updateIx (iUserName user)
               | otherwise = insert

-- | store a new user
packUser :: Bool -> InternalUser -> Update Morgue InternalUser
packUser update user = do
    morgue <- get
    put $ morgue { allUsers = func user (allUsers morgue) }
    return user
    where func | update = updateIx (iUserName user)
               | otherwise = insert

-- | store a new user
packUser update user = do
    morgue <- get
    put $ morgue { allUsers = func user (allUsers morgue) }
    return user
    where func | update = updateIx (iUserName user)
               | otherwise = insert

-- | store a new user