# Haskell Playground is live at play.haskell.org

**URL:** <https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869>\
**Category:** Announcements\
**Created:** [February 25, 2023, 8:30am UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869 "2023-02-25T08:30:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kleidukos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/kleidukos/32/1213_2.png) [@Kleidukos](https://discourse.haskell.org/u/Kleidukos)\
**Post date:** [February 25, 2023, 8:30am UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/1 "2023-02-25T08:30:28Z")

</div>

Dear haskellers,  
it is with great pleasure that the [Haskell.org](http://Haskell.org) Committee is announcing the availability of the Haskell Playground at [https://play.haskell.org](https://play.haskell.org)!

The playground is a work of love by @tomsmeding, now with support from [Haskell.org](http://Haskell.org). He deserves all your encouragement!

* * *

Now, to the details:

## Exposed Packages

> **Click here to see the list of exposed packages**
>
> - aeson,
> - array,
> - assoc,
> - async,
> - attoparsec,
> - base,
> - base16,
> - base64,
> - bifunctors,
> - binary,
> - bytestring,
> - Cabal,
> - comonad,
> - containers,
> - contravariant,
> - deepseq,
> - directory,
> - distributive,
> - dlist,
> - effectful,
> - effectful-core,
> - exceptions,
> - filepath,
> - generically,
> - ghc-boot,
> - ghc-boot-th,
> - ghc-heap,
> - ghci,
> - ghc-prim,
> - hashable,
> - haskeline,
> - hpc,
> - indexed-traversable,
> - integer-gmp,
> - integer-logarithms,
> - libiserv,
> - monad-control,
> - mtl,
> - parsec,
> - pretty,
> - primitive,
> - process,
> - QuickCheck,
> - random,
> - safe-exceptions,
> - scientific,
> - semialign,
> - semigroupoids,
> - stm,
> - strict,
> - template-haskell,
> - terminfo,
> - text,
> - text-short,
> - th-abstraction,
> - these,
> - time,
> - transformers,
> - transformers-base,
> - unix,
> - unliftio,
> - unliftio-core,
> - unordered-containers,
> - uuid-types,
> - vector,
> - vector-stream,
> - witherable,
> - xhtml

## GHC Versions supported

- 8.6.5
- 8.8.4
- 8.10.7
- 9.0.2
- 9.2.5
- 9.4.4

Aaaaand in bonus, thanks to @hasufell’s pre-release channel for ghcup, the two latest alpha releases of GHC 9.6 are available. Especially interesting if you want to compare Core or ASM outputs across compiler versions, test the new `TypeData` extension. You can even try out the [Delimited Continuations](https://play.haskell.org/saved/NLblFcqT).

## Sandboxing

The playground uses [Bubblewrap](https://github.com/containers/bubblewrap) for sanboxing.

## API

You can perform an API request to the playground like this:

```json
{
  "code": "main :: IO ()\nmain = print 42",
  "version": "9.2.4", // or "8.10.7", or "9.6.0.20230210", etc.
  "opt": "O1", // "O0", "O1" or "O2"
  "output": "run" // "run", "core" or "asm"
}

```

## Playground Initialisation

If you wish to provide a link that open a new playground with custom code, you can provide the code url-encoded as the `code` query parameter, like this:

> **[Haskell Playground](https://play.haskell.org/?code=main%20%3A%3A%20IO%20%28%29%0Amain%20%3D%20putStrLn%20%22Hello%20Discourse%21%22)**

Happy hacking!

---

<div class="post-metadata">

**Author:** ![artem](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/artem/32/56_2.png) [@artem](https://discourse.haskell.org/u/artem)\
**Post date:** [February 26, 2023, 9:03pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/2 "2023-02-26T21:03:27Z")

</div>

Is the set of available packages final? For little experiments (kinda what tools like this one are well suited) I like to use `extra`.

Also, `vector` usually makes more sense if `vector-algorithms` is available.

---

<div class="post-metadata">

**Author:** ![tomsmeding](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomsmeding/32/2344_2.png) [@tomsmeding](https://discourse.haskell.org/u/tomsmeding)\
**Post date:** [February 26, 2023, 9:43pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/3 "2023-02-26T21:43:35Z")

</div>

The set of available packages is not final at all! I’m not comfortable yet with including all of Stackage, not least because of the disk space and build time requirements. So at least for now, sensible requests like yours are welcome.

In fact if you look again, you’ll see that your suggested packages are now available on all provided GHC versions. 🙂

The full list of available packages is [here](https://github.com/haskell/play-haskell/blob/master/play-haskell-worker/bwrap-files/mkbuildscript.sh#L27-L39), which is of course not very convenient to read/find. Making this nicely available in the interface (and fixing synchronisation of package versions across multiple worker machines) is a TODO item.

---

<div class="post-metadata">

**Author:** ![turion](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/turion/32/989_2.png) [@turion](https://discourse.haskell.org/u/turion)\
**Post date:** [February 28, 2023, 7:46pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/4 "2023-02-28T19:46:36Z")

</div>

This is fantastic! Great job, and a great addition to the ecosystem!

Just one suggestion: Maybe it’s possible to start with a simpler example? For Haskell newcomers who have just been patted on the back by a seasoned Haskeller with the words “No worries, you don’t need to understand category theory for this” it’s maybe a bit intimidating to start with `import Data.Bifunctor`. One could rewrite the example by expanding the `first` and `second` functions, or defining `toright` and `toleft` with an accumulator argument, …

---

<div class="post-metadata">

**Author:** ![tomsmeding](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomsmeding/32/2344_2.png) [@tomsmeding](https://discourse.haskell.org/u/tomsmeding)\
**Post date:** [March 1, 2023, 1:05pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/5 "2023-03-01T13:05:07Z")

</div>

For other readers: this has been addressed in the course of fixing [#23](https://github.com/haskell/play-haskell/issues/23) 🙂

---

<div class="post-metadata">

**Author:** ![polarit](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/polarit/32/2977_2.png) [@polarit](https://discourse.haskell.org/u/polarit)\
**Post date:** [March 3, 2023, 4:46pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/6 "2023-03-03T16:46:32Z")

</div>

Playground is fantastic!  
It’s fun to use.

I have made [this in the playground](https://play.haskell.org/saved/9Cr0yGYa) today, surprisingly quickly almost from scratch.  
Here is a new [better version](https://play.haskell.org/saved/f0L1QepM) of it.

---

<div class="post-metadata">

**Author:** ![Swordlash](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/swordlash/32/4604_2.png) [@Swordlash](https://discourse.haskell.org/u/Swordlash)\
**Post date:** [March 7, 2023, 4:27pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/7 "2023-03-07T16:27:21Z")

</div>

Would it be possible to somehow integrate the playground with HLS?

---

<div class="post-metadata">

**Author:** ![tomsmeding](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomsmeding/32/2344_2.png) [@tomsmeding](https://discourse.haskell.org/u/tomsmeding)\
**Post date:** [March 7, 2023, 4:45pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/8 "2023-03-07T16:45:17Z")

</div>

In what way do you imagine that?

---

<div class="post-metadata">

**Author:** ![olf](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/olf/32/3813_2.png) [@olf](https://discourse.haskell.org/u/olf)\
**Post date:** [April 27, 2024, 7:47pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/9 "2024-04-27T19:47:28Z")

</div>

Dearest thanks to @tomsmeding for this gem! I successfully used it to demo some combinatorics in a school environment, where no-setup coding solutions like this are particularly helpful.  
The greatest feature for getting the teachers to use Haskell is the “save and share” button. What I could not determine from the source code (and what is probably local to the server instance): Is there a limit for how long saved source code is stored? Will a link to [play.haskell.org/saved/](http://play.haskell.org/saved/) expire some day or continue to function until the database is full, like the source code suggests?

---

<div class="post-metadata">

**Author:** ![Kleidukos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/kleidukos/32/1213_2.png) [@Kleidukos](https://discourse.haskell.org/u/Kleidukos)\
**Post date:** [April 27, 2024, 7:54pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/10 "2024-04-27T19:54:57Z")

</div>

Thanks for the feedback! This is really heartwarming

---

<div class="post-metadata">

**Author:** ![tomsmeding](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomsmeding/32/2344_2.png) [@tomsmeding](https://discourse.haskell.org/u/tomsmeding)\
**Post date:** [April 27, 2024, 8:11pm UTC](https://discourse.haskell.org/t/haskell-playground-is-live-at-play-haskell-org/5869/11 "2024-04-27T20:11:36Z")

</div>

Thanks, happy to hear that it’s useful! Yes, there is currently no expiration on the saved snippets. In theory, this doesn’t scale at all; in practice, the database growth rate is, as yet, slow enough. We’ll have to see if usage remains relatively quiet in the future. 🙂
