Ticket #128 (new enhancement)

Opened 4 years ago

Fuzzy Find for Tab Completion

Reported by: guest Owned by:
Priority: major Milestone:
Version: Keywords:
Cc: dmbarbour@…


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

Note: See TracTickets for help on using tickets.