play-haskell
play-haskell copied to clipboard
Feature: code contents in long compressed link
Feature request
By putting the written content in the link in an anchor, the frontend could even live-update the URL while you're typing, so that there isn't even a separate save button to press. The Lean playground does this: https://live.lean-lang.org/#codez=CYUwZgBJBcEHIEMAuFoF4IEYBQQ
"Long" is not exaggerated. Using the same library that the Lean playground uses (https://github.com/pieroxy/lz-string), the "Hello Haskell Curry" example (of 38 lines) would result in the following link (if support was implemented):
https://play.haskell.org/#codez=N4WgxABAMgggcgcQKowQUQgeQG4FMBOANgPYCGAJruQMoAu+AlgHYDmAzhGCAL4BQvDALYAHYvloQAjgFdShBgDMGVCABFStUgDoAKrgAeE0hx0CRYiTLmLl5NRu06huCMYhPBufuQcQAagxsDLRivBAQALwQALK4ggBGBBAACvjESoRe4QA+EHDETLEJSQAU0aQAnonuuga0AJRhEJSM2MwsENQAFsQA7t6+qekMmZFNQxlZ4RDAEEyknhAAXEs1eoZN4QA0EPEM4l0+FcurHrha6hWbENzNBAxtrJ09/byCpMwnEACSmBAljXenyi5GITUyEi6xgA1rhCIRIjE4ol8Ck0pNrtMZnMFi4ogAiAASMLhCIAwtJ8PgKvjMdMdnsDkdEfhcBQIPiAIwATgADLyQLzuSBOQAmWlYrF8cIsVm4WjtCAAHhAEHesIQcoVTyhbFh8KawmktDo+CgTAgABIatImMJSABjaEQWW4eXtfjq3Cat3ajorfyBYJiCAgAB8Pz+OlqGy9PvdTzaQRCqIiTQdxhcSeDqPS13yhWRSXeVVwcFxobDdKNrKtEAzbBcJcS5cWecl0wAUtI2BJ5otwxzCaTiDt8cqI/2XEqI/iAIQSjt5Yi0LqK8KDokjnaCCq9+7EHsQbMphfXIooiDCdEjFyD0F0kLMlXuZxaY0O2iXZWWiNnLQsPKFJUrgTC0GcdIQmqBSrjATDkN+UQlAAOiUAD6FQ7js5D1JW/yCNh9S4Vor6eFoIQ+iwYgMKQTB0oo0FgV0cEIZUEBPmxERRIIMHMfB34lIyq7MtewyZI0HarqBV6Ui41pEqQwjCMcQmHJUY4TjiiyiZMmnzouWJwo2Mm1vJADqcIOsQizxI60IaTOWkuDpt56WeQA
Given that a prime usecase of the Haskell playground is for sharing code snippets on IRC, the GHC issue tracker, and similar spaces (and the link above doesn't even fit in 1 IRC message), I wouldn't want people to start spamming links like this. Hence I'm indefinitely postponing implementing this.
Feel free to try to convince me otherwise.