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.Identifier

Description

This module defines support for working with IRC's numeric reply codes. Pattern synonyms are provided for each of the possible IRC reply codes.

Reply code information was extracted from https://www.alien.net.au/irc/irc2numerics.html

Synopsis

- data Identifier
- idDenote :: Identifier -> ByteArray
- mkId :: Text -> Identifier
- idText :: Identifier -> Text
- idTextNorm :: Identifier -> Text
- idPrefix :: Identifier -> Identifier -> Bool

# Documentation

data Identifier Source #

Identifier representing channels and nicknames

#### Instances

Instances details

IsString Identifier Source # | @`fromString` = `mkId` . `fromString`
Instance details Defined in Irc.Identifier Methods fromString :: String -> Identifier Source #
Read Identifier Source # | Read as string literal
Instance details Defined in Irc.Identifier Methods readsPrec :: Int -> ReadS Identifier Source # readList :: ReadS [Identifier] Source # readPrec :: ReadPrec Identifier Source # readListPrec :: ReadPrec [Identifier] Source #
Show Identifier Source # | Show as string literal
Instance details Defined in Irc.Identifier Methods showsPrec :: Int -> Identifier -> ShowS Source # show :: Identifier -> String Source # showList :: [Identifier] -> ShowS Source #
Eq Identifier Source # | Equality on normalized identifier
Instance details Defined in Irc.Identifier Methods (==) :: Identifier -> Identifier -> Bool Source # (/=) :: Identifier -> Identifier -> Bool Source #
Ord Identifier Source # | Comparison on normalized identifier

Instance details

Defined in Irc.Identifier

Methods

compare :: Identifier -> Identifier -> Ordering Source #

(<) :: Identifier -> Identifier -> Bool Source #

(<=) :: Identifier -> Identifier -> Bool Source #

(>) :: Identifier -> Identifier -> Bool Source #

(>=) :: Identifier -> Identifier -> Bool Source #

max :: Identifier -> Identifier -> Identifier Source #

min :: Identifier -> Identifier -> Identifier Source #

Hashable Identifier Source # | Hash on normalized identifier
Instance details Defined in Irc.Identifier Methods hashWithSalt :: Int -> Identifier -> Int Source # hash :: Identifier -> Int Source #

idDenote :: Identifier -> ByteArray Source #

Returns a `ByteArray` of an `Identifier` which is suitable for comparison or hashing which has been normalized for case.

mkId :: Text -> Identifier Source #

Construct an `Identifier` from a `ByteString`

idText :: Identifier -> Text Source #

Returns the original `Text` of an `Identifier`

idTextNorm :: Identifier -> Text Source #

Returns the case-normalized `Text` for an identifier.

idPrefix :: Identifier -> Identifier -> Bool Source #

Returns `True` when the first argument is a prefix of the second.