Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Noob List Woes (Duke Normandin)
----------------------------------------------------------------------
Message: 1
Date: Wed, 17 Dec 2025 21:44:43 -0700
From: Duke Normandin <[email protected]>
Subject: [Haskell-beginners]Noob List Woes
To: Haskell Beginners <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
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
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list -- [email protected]
To unsubscribe send an email to [email protected]
------------------------------
End of Beginners Digest, Vol 178, Issue 2
*****************************************