Dear haskellers,
it is with great pleasure that the Haskell.org Committee is announcing the availability of the Haskell Playground at https://play.haskell.org!
The playground is a work of love by @tomsmeding, now with support from 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.
Sandboxing
The playground uses Bubblewrap for sanboxing.
API
You can perform an API request to the playground like this:
{
"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:
https://play.haskell.org/?code=main%20%3A%3A%20IO%20()
main%20%3D%20putStrLn%20"Hello%20Discourse!"
Happy hacking!