Just started learning Haskell!
Currently watching this particular video:
https://youtu.be/vhsONvQc-Dc?list=PLmTgnNwroyn8TnF26YRvW-hvQF1ypztzg
in the seies. I copied his code verbatim, but keep getting errors
running the code on my antiX-23.2 Linux box using a fresh Haskell
install.
[quote]
main = do
let testScores = [79,85,92,56]
print (testScores !! 0) -- !! means index-of
print (testScores !! 3) -- last item
print (head testScores) -- returns first item in a list
[/quote]
[quote]
runghc "hello.hs" (in
directory: /home/dnormandin/Programming/haskell/code) hello.hs:1:8:
error: [GHC-52095] Unexpected do block in function application:
do let testScores = ...
Suggested fixes:
• Use parentheses.
• Perhaps you intended to use BlockArguments
You may enable this language extension in GHCi with:
:set -XBlockArguments
|
1 | main = do
| ^^...
Compilation failed.
[/quote]
I can't figure out what's wrong with the code. I _think_ that the
indenting is ok - which BTW is a bloody PITA!!
I have some cl/scheme experience, but mostly with procedural langs.
Maybe the tutorial is too dated to be useful? If it is, is there a
similar video tutorial for beginners? TIA ...
--
Duke