glirc-2.13: Console IRC client

Copyright(c) Eric Mertens, 2016
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.Commands.WordCompletion

Description

This module provides the tab-completion logic used for nicknames and channels.

Synopsis

Documentation

class (IsString a, Ord a) => Prefix a Source #

Class for types that are isomorphic to String and which can support a total order and a prefix predicate.

toString (fromString x) == x
fromString (toString x) == x
isPrefix x y ==> x <= y

Minimal complete definition

isPrefix, toString

wordComplete Source #

Arguments

:: Prefix a 
=> (String -> String)

leading update operation

-> Bool

reversed

-> [a]

priority completions

-> [a]

possible completions

-> EditBox 
-> Maybe EditBox 

Perform word completion on a text box.

The leading update operation is applied to the result of tab-completion when tab completing from the beginning of the text box. This is useful when auto-completing a nick and including a trailing colon.

The reversed parameter indicates that tab-completion should return the previous entry. When starting a fresh tab completion the priority completions will be considered in order before resorting to the set of possible completions.