onlyOne :: [a] -> Maybe a
onlyOne xs =
  case xs of
    [] -> Nothing
    [x] -> Just x
    _ -> throw DuplicateAccount
onlyOne :: [a] -> Maybe a
onlyOne xs =
  case xs of
    [] -> Nothing
    [x] -> Just x
    _ -> throw DuplicateAccount
onlyOne xs =
  case xs of
    [] -> Nothing
    [x] -> Just x
    _ -> throw DuplicateAccount