-- Selects a user from the database with the given user, if the
-- user is not found runs the nothing computation, otherwise
-- the just computation with the user as a parameter.
withUser username nothing just =
  getBy (UniqueUsername $ Domain.usernameCata Text.pack username) >>= maybe nothing just
withUser username nothing just =
  getBy (UniqueUsername $ Domain.usernameCata Text.pack username) >>= maybe nothing just
withUser username nothing just =
  getBy (UniqueUsername $ Domain.usernameCata Text.pack username) >>= maybe nothing just