[haskeline] #128: Fuzzy Find for Tab Completion
haskeline
haskeline at projects.haskell.org
Wed Dec 25 16:20:45 GMT 2013
#128: Fuzzy Find for Tab Completion
------------------------+---------------------------------------------------
Reporter: guest | Owner:
Type: enhancement | Status: new
Priority: major | Milestone:
Version: | Keywords:
------------------------+---------------------------------------------------
When using Haskeline, I wanted to use a fuzzy-find algorithm for tab
completion, i.e. of the form:
fuzzyFind [] _ = True
fuzzyFind _ [] = False
fuzzyFind (a:as) (b:bs)
| (a == b) = fuzzyFind as bs
| otherwise = fuzzyFind (a:as) bs
completeWord Nothing " \n[]()" $
map simpleCompletion . flip filter dict . fuzzyFind
Fuzzy find is very useful in a system where words often have prefixes or
suffixes that we don't want to fully type, i.e. users may disambiguate on
the middle of a word, or skip straight to the suffix. Unfortunately,
Haskeline simply deletes my completions when I use this technique. It
seems that very few completion predicates other than `isPrefixOf` are
valid (at least, I haven't been able to find one).
--
Ticket URL: <http://trac.haskell.org/haskeline/ticket/128>
haskeline <http://example.org/>
My example project
More information about the Haskeline
mailing list