Replit
Initial Configuration
You can load the recommended beginner’s Haskell setup by using the WY Haskell Base 2024 template as your starting point. You can begin with Replit’s stock Haskell setup.
Replit requires a main method
The particular interpreter repl.it requires that you have a main method. Write a simple one and then type your tests in the interactions pane.
main = do putStrLn "Loaded"
putStrLn (show [1..10])
Replit needs variables
No “top-level” statements are allowed, everything must be assigned to a variable or in a function.
Example: [0..100]
on a line by itself should be written question1 = [0..100]
.
This is different from the way Racket works.
Miscellany
There are invisible configuration files you can use to more precisely control what happens when you click the “Run” button.
Details: Choose the “Show config files” option in the file browser pane.
For example, you could edit the now-visible .replit
file so the contents are:
language = "haskell"
run = "ghci src/Main.hs"
# run = "ghci src/Main.hs -e main" # runs and quits