| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell98 | 
System.Console.Haskeline.Completion
Synopsis
- type CompletionFunc m = (String, String) -> m (String, [Completion])
- data Completion = Completion {- replacement :: String
- display :: String
- isFinished :: Bool
 
- noCompletion :: Monad m => CompletionFunc m
- simpleCompletion :: String -> Completion
- fallbackCompletion :: Monad m => CompletionFunc m -> CompletionFunc m -> CompletionFunc m
- completeWord :: Monad m => Maybe Char -> [Char] -> (String -> m [Completion]) -> CompletionFunc m
- completeWord' :: Monad m => Maybe Char -> (Char -> Bool) -> (String -> m [Completion]) -> CompletionFunc m
- completeWordWithPrev :: Monad m => Maybe Char -> [Char] -> (String -> String -> m [Completion]) -> CompletionFunc m
- completeWordWithPrev' :: Monad m => Maybe Char -> (Char -> Bool) -> (String -> String -> m [Completion]) -> CompletionFunc m
- completeQuotedWord :: Monad m => Maybe Char -> [Char] -> (String -> m [Completion]) -> CompletionFunc m -> CompletionFunc m
- completeFilename :: MonadIO m => CompletionFunc m
- listFiles :: MonadIO m => FilePath -> m [Completion]
- filenameWordBreakChars :: String
Documentation
type CompletionFunc m = (String, String) -> m (String, [Completion]) #
data Completion #
Constructors
| Completion | |
| Fields 
 | |
Instances
| Show Completion # | |
| Defined in System.Console.Haskeline.Completion | |
| Eq Completion # | |
| Defined in System.Console.Haskeline.Completion | |
| Ord Completion # | |
| Defined in System.Console.Haskeline.Completion Methods compare :: Completion -> Completion -> Ordering # (<) :: Completion -> Completion -> Bool # (<=) :: Completion -> Completion -> Bool # (>) :: Completion -> Completion -> Bool # (>=) :: Completion -> Completion -> Bool # max :: Completion -> Completion -> Completion # min :: Completion -> Completion -> Completion # | |
noCompletion :: Monad m => CompletionFunc m #
Disable completion altogether.
simpleCompletion :: String -> Completion #
Create a finished completion out of the given word.
fallbackCompletion :: Monad m => CompletionFunc m -> CompletionFunc m -> CompletionFunc m #
If the first completer produces no suggestions, fallback to the second completer's output.
Word completion
Arguments
| :: Monad m | |
| => Maybe Char | An optional escape character | 
| -> [Char] | Characters which count as whitespace | 
| -> (String -> m [Completion]) | Function to produce a list of possible completions | 
| -> CompletionFunc m | 
A custom CompletionFunc which completes the word immediately to the left of the cursor.
A word begins either at the start of the line or after an unescaped whitespace character.
Arguments
| :: Monad m | |
| => Maybe Char | An optional escape character | 
| -> (Char -> Bool) | Characters which count as whitespace | 
| -> (String -> m [Completion]) | Function to produce a list of possible completions | 
| -> CompletionFunc m | 
The same as completeWord but takes a predicate for the whitespace characters
Arguments
| :: Monad m | |
| => Maybe Char | An optional escape character | 
| -> [Char] | Characters which count as whitespace | 
| -> (String -> String -> m [Completion]) | Function to produce a list of possible completions. The first argument is the line contents to the left of the word, reversed. The second argument is the word to be completed. | 
| -> CompletionFunc m | 
A custom CompletionFunc which completes the word immediately to the left of the cursor,
 and takes into account the line contents to the left of the word.
A word begins either at the start of the line or after an unescaped whitespace character.
Arguments
| :: Monad m | |
| => Maybe Char | An optional escape character | 
| -> (Char -> Bool) | Characters which count as whitespace | 
| -> (String -> String -> m [Completion]) | Function to produce a list of possible completions. The first argument is the line contents to the left of the word, reversed. The second argument is the word to be completed. | 
| -> CompletionFunc m | 
The same as completeWordWithPrev but takes a predicate for the whitespace characters
Arguments
| :: Monad m | |
| => Maybe Char | An optional escape character | 
| -> [Char] | Characters which set off quotes | 
| -> (String -> m [Completion]) | Function to produce a list of possible completions | 
| -> CompletionFunc m | Alternate completion to perform if the cursor is not at a quoted word | 
| -> CompletionFunc m | 
Filename completion
completeFilename :: MonadIO m => CompletionFunc m #
listFiles :: MonadIO m => FilePath -> m [Completion] #
List all of the files or folders beginning with this path.