3 ms·
What is it like to auto complete in a functional language? In OO if I have an instance of a file f = new File(...) Then in my editor I type `f.` and I ge
by asiachick 6y ago
What is it like to auto complete in a functional language?
In OO if I have an instance of a file
f = new File(...)
Then in my editor I type `f.` and I get Close/Read/Write as possible completions.
In some functional language I have a `f` an instance of a File, what do I press to get all the list of common things I can do with with a file?
Is that better or worse or what?
- ahmedalsudani 6y agoThat kind of intelligent auto-complete does not require OO. It requires static types.
- asiachick 6y agoyou didn't answer my question. I already said I had a type, the type is `File`. Instance of that is `f`. What do I type to see ways to use `f`?
- ahmedalsudani 6y ago¯\_(ツ)_/¯ depends on your code editor and your tooling. In strongly typed functional languages (Haskell, MLs), you don’t even use OO syntax. Instead you pass your objects into functions. E.g. in Haskell: writeToFile file data So the topic of the question does not really apply to functional languages. Personally I gave up on auto-complete with Haskell a long time ago, and it hasn’t been a difficult adjustment. Writing Haskell is still way more pleasant than C++.