reubenharry / haskell-docs

Creative Commons Attribution 4.0 International
59 stars 7 forks source link

Online code playground #26

Open reubenharry opened 1 year ago

reubenharry commented 1 year ago

A longer term goal. It would be really nice if the code snippets in the docs were runnable online and/or if HLS or Hackage style code highlighting was available.

With the advent of WASM and JS backends, this is something to think about.

cdsmith commented 1 year ago

You're welcome to look into using https://code.world/haskell for this. It's unfortunately on GHC 8.6 now. I look forward to updating it to a modern GHC as soon as the JS or WASM backends are stable. It's also got a pretty large selection of packages available, listed at https://github.com/google/codeworld/blob/master/codeworld-available-pkgs/codeworld-available-pkgs.cabal#L13

reubenharry commented 1 year ago

That would be cool! Do you have any thoughts on how one would go about embedding this into a MkDocs page?

Separately, I should probably add a link to a nice CodeWorld example early on in the docs. The Fourier example is so neat!

(Btw, on a separate note, I'm delighted to see both dunai and monad-bayes as included packages - there's some reactive style code I've been working on that I might try to port, so I can share it more easily: https://github.com/reubenharry/rhine-bayes-examples#real-time-bayesian-agents)