haskeline-0.6.2.2: A command-line interface for user input, written in Haskell.ContentsIndex
System.Console.Haskeline.Completion
Contents
Building CompletionFuncs
Filename completion
Synopsis
type CompletionFunc m = (String, String) -> m (String, [Completion])
data Completion = Completion {
replacement :: String
display :: String
isFinished :: Bool
}
completeWord :: Monad m => Maybe Char -> String -> (String -> m [Completion]) -> CompletionFunc m
completeQuotedWord :: Monad m => Maybe Char -> String -> (String -> m [Completion]) -> CompletionFunc m -> CompletionFunc m
noCompletion :: Monad m => CompletionFunc m
simpleCompletion :: String -> Completion
completeFilename :: MonadIO m => CompletionFunc m
listFiles :: MonadIO m => FilePath -> m [Completion]
filenameWordBreakChars :: String
Documentation
type CompletionFunc m = (String, String) -> m (String, [Completion])

Performs completions from the given line state.

The first String argument is the contents of the line to the left of the cursor, reversed. The second String argument is the contents of the line to the right of the cursor.

The output String is the unused portion of the left half of the line, reversed.

data Completion
Constructors
Completion
replacement :: StringText to insert in line.
display :: StringText to display when listing alternatives.
isFinished :: BoolWhether this word should be followed by a space, end quote, etc.
show/hide Instances
completeWord
:: Monad m
=> Maybe CharList of characters which count as whitespace
-> StringFunction to produce a list of possible completions
-> String -> m [Completion]
-> CompletionFunc m
The following function creates a custom CompletionFunc for use in the 'Settings.'
completeQuotedWord
:: Monad m
=> Maybe Char
-> StringFunction to produce a list of possible completions
-> String -> m [Completion]Alternate completion to perform if the cursor is not at a quoted word
-> CompletionFunc m
-> CompletionFunc m
Building CompletionFuncs
noCompletion :: Monad m => CompletionFunc m
Disable completion altogether.
simpleCompletion :: String -> Completion
Create a finished completion out of the given word.
Filename completion
completeFilename :: MonadIO m => CompletionFunc m
listFiles :: MonadIO m => FilePath -> m [Completion]
List all of the files or folders beginning with this path.
filenameWordBreakChars :: String
Produced by Haddock version 2.6.0