News for hackers. Stuff that matters.
Re:What I Want from a Type System (2016) by seanmcdirmid on Monday July 01, 2019 @10:08AM (#20325354)
> The Haskellite approach would also say that "what operations are available on that thing" is the wrong way round; you define your operation, and the type signature tells you what kind of things will work with it.

How does code completion work in Haskell IDEs then? It doesn’t seem that it would have a decent anchor.

Re:What I Want from a Type System (2016) by dpratt71 on Monday July 01, 2019 @03:04PM (#20328634)
This is a sad reminder to me that the tooling story around Haskell seems to be perpetually almost really good.

Case in point, the core toolchain (e.g. the compiler itself) supports "typed holes". Basically, you drop a placeholder somewhere in an expression and the compiler will infer and report the type of the sub-expression. There are also tools to search either within a program/library or e.g. the entirety of the Hackage package database for functions matching a certain type. It seems like a relatively short distance from there to having an IDE or code editor that can list possible expressions/functions that could satisfy a particular placeholder. And to me, having e.g. a list functions that transforms the input(s) I have to the output I need seems much better than e.g. a partial list of all the functions that relate to a particular type.

And maybe such a thing exists today, but I have had really bad luck trying to get Haskell tooling that works well and is easy to set up.

Re:What I Want from a Type System (2016) by marcosdumay on Monday July 01, 2019 @11:43AM (#20326487)
TL/DR, completing MyClass.someAction is not very different from myClass_someAction.

Outside of the C++/Java/.Net world, names tend to be much smaller.

Anyway, it works like autocompletion works on any textual input, a couple of characters severely restrict the amount of words you are trying to write, and context guides on the rest.

Haskell in particular tends to exhibit local variables that are less than a couple of characters long, so autocomplete does not even make sense for those.

Globals tend to have wither short distinctive names when they are more generic, or long prefixed names when they are concrete. Either way, just completing over a dictionary gets results that are at least as good as you'll get on Java/.Net/C++ IDEs. Haskell also brings a lot of added context, but I don't know of any IDE that uses those for completion (and honestly, I don't miss it).

Re:What I Want from a Type System (2016) by seanmcdirmid on Monday July 01, 2019 @12:28PM (#20326970)
> Outside of the C++/Java/.Net world, names tend to be much smaller.

That has little to do with code completion, which is more about API discovery than saving on typing. It seems like many Haskell enthusiasts never figured that out, so they didn’t bother with it in tool development. Which is funny, given with all that extra strong typing, they might be able to come up with an experience that is much better than the other languages, but I guess not yet.

Re:What I Want from a Type System (2016) by rossng on Monday July 01, 2019 @12:48PM (#20327204)
Hoogle is pretty nice, and few other languages had an equivalent until quite recently.

I'm hopeful that cool type-powered IDE features will start to arrive once haskell-ide-engine is a bit more stable. It's getting there!

There are some pretty awesome IDE ideas in Haskell-ish languages like Idris [1], too. There is some movement towards dependent types in Haskell, so it might get similar features one day.

[1] https://www.youtube.com/watch?v=mOtKD7ml0NU

Re:What I Want from a Type System (2016) by pcstl on Monday July 01, 2019 @01:06PM (#20327415)
Well, we have Intero (https://haskell-lang.org/intero) now.
Re:What I Want from a Type System (2016) by lilactown on Monday July 01, 2019 @02:45PM (#20328425)
I haven't used Haskell, but in OCaml things tend to be organized in modules related to the particular type, which allows you to get autocomplete like:

    List.
        | length
        | hd
        | tl
         ...