Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred



Process a textual language, which may look familiar, to perform UI state changes.

The incoming commands are received via Msg.Socket msgs.

TODO currently this will reload any updated modules as interpreted. While I want to do this for explicitly named modules (Cmd.Repl.Environ and LocalRepl *.hs), it's just annoying and brittle when applied to the main src files. Is there a way to get ghc to load the objects even if the source files are newer?



with_socket :: (Socket.Socket -> IO.IO a) -> IO.IO a Source #

Acquire a new unix socket, and delete when done.

This tries to find an unused socket name. It might seem like overkill, but the previous strategy of unconditionally deleting and recreating the single socket meant that accidentally starting the app twice in the same directory would make the first one unreachable.

type Session = ReplImpl.Session Source #

This is the persistent interpreter session which is stored in the global state.

interpreter :: Session -> IO.IO () Source #

This is the interpreter thread, which should be started when the app starts. It's in a separate thread so it can run in its own monad.

accept_msg :: Socket.Socket -> IO.IO (Maybe (IO.Handle, ReplProtocol.Query)) Source #

Block and read a single message from the REPL client, and return it along with a response handle. The Query should eventually make it's way to respond.