irc-core-2.13: IRC core library for glirc

Copyright | (c) Eric Mertens 2016
License | ISC
Maintainer | emertens@gmail.com
Safe Haskell | None
Language | Haskell2010

Irc.UserInfo

Contents

- Type
- Parser and printer
- Lenses

Description

Information identifying users on IRC. This information includes a nickname and optionally a username and hostname.

Synopsis

- data UserInfo = UserInfo {
  - userNick :: !Identifier
  - userName :: !Text
  - userHost :: !Text
  }
- renderUserInfo :: UserInfo -> Text
- parseUserInfo :: Text -> UserInfo
- uiNick :: Functor f => (Identifier -> f Identifier) -> UserInfo -> f UserInfo
- uiName :: Functor f => (Text -> f Text) -> UserInfo -> f UserInfo
- uiHost :: Functor f => (Text -> f Text) -> UserInfo -> f UserInfo

# Type

data UserInfo Source #

`UserInfo` packages a nickname along with the username and hostname if they are known in the current context.

Constructors

UserInfo |

Fields

- userNick :: !Identifier

  nickname

- userName :: !Text

  username, empty when missing

- userHost :: !Text

  hostname, empty when missing

#### Instances

Instances details

Read UserInfo Source # |
Instance details Defined in Irc.UserInfo Methods readsPrec :: Int -> ReadS UserInfo Source # readList :: ReadS [UserInfo] Source # readPrec :: ReadPrec UserInfo Source # readListPrec :: ReadPrec [UserInfo] Source #
Show UserInfo Source # |
Instance details Defined in Irc.UserInfo Methods showsPrec :: Int -> UserInfo -> ShowS Source # show :: UserInfo -> String Source # showList :: [UserInfo] -> ShowS Source #
Eq UserInfo Source # |
Instance details Defined in Irc.UserInfo Methods (==) :: UserInfo -> UserInfo -> Bool Source # (/=) :: UserInfo -> UserInfo -> Bool Source #
Ord UserInfo Source # |
Instance details Defined in Irc.UserInfo Methods compare :: UserInfo -> UserInfo -> Ordering Source # (<) :: UserInfo -> UserInfo -> Bool Source # (<=) :: UserInfo -> UserInfo -> Bool Source # (>) :: UserInfo -> UserInfo -> Bool Source # (>=) :: UserInfo -> UserInfo -> Bool Source # max :: UserInfo -> UserInfo -> UserInfo Source # min :: UserInfo -> UserInfo -> UserInfo Source #

# Parser and printer

renderUserInfo :: UserInfo -> Text Source #

Render `UserInfo` as `nick!username@hostname`

parseUserInfo :: Text -> UserInfo Source #

Split up a hostmask into a nickname, username, and hostname. The username and hostname might not be defined but are delimited by a `!` and `@` respectively.

# Lenses

uiNick :: Functor f => (Identifier -> f Identifier) -> UserInfo -> f UserInfo Source #

Lens into `userNick` field.

uiName :: Functor f => (Text -> f Text) -> UserInfo -> f UserInfo Source #

Lens into `userName` field.

uiHost :: Functor f => (Text -> f Text) -> UserInfo -> f UserInfo Source #

Lens into `userHost` field.