-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search by example #12
Comments
I've made a function that filters a list of functions by output given an input, but all the functions have to have the same signature. That's okay as |
Sorry for bring absent. I'm busy until a parental leave starting in one or two weeks. Will get back to you then... |
Cool! I'll try to figure things out in the meantime. |
Thought I'd record this test case from a question on Slack. |
Type searches often find many results you have to look through. You then either have to know what each function's name means, or hope the function's author has described what it does well.
We talked before with @knewter (sadly the recording was lost) about being able to give Elm Search the data you have (input), and the data you want (output), and for it to narrow down your search for you. As an example, String.reverse could be found with
"123" -> "321"
.To begin with, there could be an extra field for
"123" -> "321"
, as well as the existing field forString -> String
. The results fromString -> String
could be narrowed down by giving"123"
to every function found, filtering by ones that return"321"
. In time,String -> String
could be inferred from"123" -> "321"
the way the compiler does it now.This could form the foundation of a tool that could write complete programs for you, based on your specifying what data you have (inputs), and what data you want (output). You would also be doing test-driven development.
The text was updated successfully, but these errors were encountered: