Ghci "ide" commands - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sandy Maguire

Did y'all know ghci supports commands like :loc-at to support definition at cursor, :type-at for types of expressions at cursor, and :uses-of to find uses at cursor????

Sandy Maguire

and APPARENTLY HAS SINCE 8.01

Bolt

How am I supposed to use it in the repl though?

Sandy Maguire

you're supposed to pipe an editor to the repl

Bolt

ohhh makes sense!

James King

I supposed this is how Dante works, and to some degree how Intero works. Interestingly this is similar to how Lean works -- they have a "server" mode that listens for commands on a local port and it speaks JSON.

James King

And if you haven't tried it, the developer experience of using Lean is next level. Highly interactive, very cool.

Sandy Maguire

this is amazing! i wrote some shitty vim/tmux/ghci bindings that play together

Sandy Maguire

but my type-of button just pastes in the name

Asad Saeeduddin

idk if you've tried it, but ghcide also works pretty good and has all these features

Torsten Schmits

Asad Saeeduddin said:

idk if you've tried it, but ghcide also works pretty good and has all these features

how so? except for the type and local definitions

Asad Saeeduddin

yes, except for the features it has, it doesn't have any features

Torsten Schmits

well, it's a very small subset of what @Sandy Maguire reported

Asad Saeeduddin

You're right. It doesn't support :uses-at. I'm not sure I agree that 2/3 is a very small subset though

Torsten Schmits

my point was that it doesn't support definition at cursor for dependencies, which, in my experience, is much more substantial than local definitions

Torsten Schmits

mainly because keeping track of the sources of dependencies, indexing and so on, is a non-trivial task regarding performance and memory usage

Vance Palacio

@James King What's lean? Haskell ide type of thing? Is there a github for this?

Vance Palacio

Nvm, found it lol
https://github.com/leanprover/lean

Lean Theorem Prover. Contribute to leanprover/lean development by creating an account on GitHub.
James King

It's a depently typed language and theorem prover: https://leanprover.github.io/

I've been writing a guide for hackers: https://agentultra.github.io/lean-for-hackers/

James King

To me it represents the pinnacle in interactive development.

Vance Palacio

Hey, thats an awesome write up! The official documentation I found made lean seem like not very attainable. Thats really cool

James King

They're really focused on making Lean usable for pure mathematicians doing research. I'm more interested in programming and program verification so I've felt the documentation was a bit lacking for that audience as well. :)

Reed Mullanix

I would love to see some stuff from agda/lean get brought to haskell tools

Reed Mullanix

Especially the hole interactions for agda