prefix conf = char ':' 
              *> eitherP (userInfo <* end) (serverName <* end)
              <?> "prefix"
  where
    end = ircSpaces1 conf <|> endOfInput
    nick = nickParser conf <?> "nick"
    user = userParser conf <?> "user"
    host = hostParser conf <?> "host"
    serverName = host <?> "server name"
    userInfo = UserInfo <$> nick
                        <*> optional (char '!' >> user)
                        <*> optional (char '@' >> host)
                        <?> "user info"
prefix conf = char ':' 
              *> eitherP (userInfo <* end) (serverName <* end)
              <?> "prefix"
  where
    end = ircSpaces1 conf <|> endOfInput
    nick = nickParser conf <?> "nick"
    user = userParser conf <?> "user"
    host = hostParser conf <?> "host"
    serverName = host <?> "server name"
    userInfo = UserInfo <$> nick
                        <*> optional (char '!' >> user)
                        <*> optional (char '@' >> host)
                        <?> "user info"
prefix conf = char ':' 
              *> eitherP (userInfo <* end) (serverName <* end)
              <?> "prefix"
  where
    end = ircSpaces1 conf <|> endOfInput
    nick = nickParser conf <?> "nick"
    user = userParser conf <?> "user"
    host = hostParser conf <?> "host"
    serverName = host <?> "server name"
    userInfo = UserInfo <$> nick
                        <*> optional (char '!' >> user)
                        <*> optional (char '@' >> host)
                        <?> "user info"