https://github.com/billstclair/elm-id-search
An index to aid in auto-completion of record ids
https://github.com/billstclair/elm-id-search
Last synced: 11 months ago
JSON representation
An index to aid in auto-completion of record ids
- Host: GitHub
- URL: https://github.com/billstclair/elm-id-search
- Owner: billstclair
- License: mit
- Created: 2019-02-24T19:05:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-26T14:56:17.000Z (over 7 years ago)
- Last Synced: 2025-07-23T23:19:59.446Z (11 months ago)
- Language: Elm
- Homepage: https://billstclair.github.io/elm-id-search
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
The [billstclair/elm-id-search](http://package.elm-lang.org/packages/billstclair/elm-id-search/latest) package allows quick search for substrings of record identification strings.
You can use it to index identifying strings for any record type. For example, you could index `User` records by their userid to offer completions while typing "@foo" for a Twitter interface.
There's a live example, showing completion of lists of popular boy and girl baby names at https://billstclair.github.io/elm-id-search
An `elm repl` example:
```
$ elm repl
> import IdSearch exposing (..)
> ids = ["avh4","brianhicks","czaplic","eeue56","elmlang","lukewestby","mdgriffith","noredink","rtfeldman","terezka","zwilias"]
> table = makeTable 3 List.singleton |> insertList ids
{ dictCount = 3, dicts = [Dict ... ]
, getIdentifiers = }
: Table String
> lookup "c" table
["czaplic"] : List String
> lookup "li" table
["zwilias","czaplic"] : List String
> lookup "hicks" table
["brianhicks"] : List String
> lookup "hicke" table
[] : List String
```