ghci-websockets: A websocket server that survives GHCi reloads

[ bsd3, language, library ] [ Propose Tags ]

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

[Skip to Readme]


Maintainer's Corner

For package maintainers and hackage trustees


Versions [RSS] 0.0.1, 0.0.2
Change log
Dependencies aeson, base (<=5), containers, foreign-store, text, websockets [details]
License BSD-3-Clause
Copyright Copyright (C) 2019 Jann Mueller
Author Jann Müller
Maintainer Jann Müller (
Category Language
Home page
Bug tracker
Source repo head: git clone
Uploaded by jfmueller at 2019-07-14T21:52:48Z
Distributions NixOS:0.0.2
Downloads 745 total (0 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-14 [all 1 reports]

Readme for ghci-websockets-0.0.1

[back to package description]


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



The Ghci.Websockets module implements the actual websocket server, broadcasting JSON objects to all clients. Ghci.Websockets.Simple adds a custom message type for text, HTML, and plots on top of that.


  • Add ghci-websockets to the build-depends field of your .cabal file
  • Run cabal new-repl
  • Run Ghci.Websockets.Simple.initialiseDef
  • Open html/index.html in a browser
  • In GHCi, run Ghci.Websockets.Simple.broadcastText "hello" (see also broadcastHtml and broadcastPlot from the same module). You may need :set -XOverloadedStrings.


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


BSD-3-Clause, see LICENSE


Bug reports, pull requests etc. are welcome!