ghci-websockets: A websocket server that survives GHCi reloads

[ bsd3, language, library ] [ Propose Tags ] [ Report a vulnerability ]

A websocket server that survives GHCi reloads - use your browser to visualise results from the REPL.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1, 0.0.2
Change log CHANGELOG.md
Dependencies aeson, base (<=5), bytestring, containers, foreign-store, text, wai, wai-app-static, warp, websockets [details]
License BSD-3-Clause
Copyright Copyright (C) 2019 Jann Mueller
Author Jann Müller
Maintainer Jann Müller (j.mueller.11@alumni.ucl.ac.uk)
Category Language
Home page https://github.com/j-mueller/ghci-websockets
Bug tracker https://github.com/j-mueller/ghci-websockets/issues
Source repo head: git clone https://github.com/j-mueller/ghci-websockets
Uploaded by jfmueller at 2019-07-16T10:12:31Z
Distributions NixOS:0.0.2
Downloads 935 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-07-16 [all 1 reports]

Readme for ghci-websockets-0.0.2

[back to package description]

ghci-websockets

With ghci-websockets you can send data from GHCi straight to the browser, using a websocket connection that survives GHCi reloads.

ghci-websockets.gif

Contents

The Ghci.Server.Websockets module implements the actual websocket server, sending JSON objects to all clients. Ghci.Server.Http servers the index.html page that goes with the messages defined in Ghci.Websockets.Message.

Quickstart

  • Add ghci-websockets to the build-depends field of your .cabal file
  • Run cabal new-repl
  • Run Ghci.Server.start
  • Open localhost:3000 in a browser
  • In GHCi, run Ghci.Server.sendText "hello" (see also sendHtml and sendPlot from the same module). You may need :set -XOverloadedStrings.

Warning

This packages uses the foreign-store package internally, which is highly unstable. I wouldn't use ghci-websockets for anything other than GHCi.

License

BSD-3-Clause, see LICENSE

Contributions

Bug reports, pull requests etc. are welcome!