When I use GHCi commands (i.e. any command starting with ":"
for example :set t
) on https://tryhaskell.org/ I get an error:
:1:1: parse error on input ‘:’
According to the documentation of GHCi this should work, but I cannot find much information about it.
I've tried a few other online "repls" as well.
CodePudding user response:
That repl probably doesn't try to provide all of GHCI's functionality. It probably wants to be stateless, so it just evaluates expressions one at a time. No variable definitions, no interacting with GHCI any other way, e.g. through :t
. If you install GHCI yourself, you will have a functioning repl. Or, if you want an online repl, https://replit.com/languages/haskell seems to work fine for me.