vault backup: 2025-02-19 11:50:56
This commit is contained in:
parent
6e7db54dc7
commit
11f2b92319
@ -20,5 +20,7 @@ A Haskell compiler! The recommended one is GHC.
|
||||
|
||||
GHC can compile code but it can also run from the prompt interactively, by running 'ghci'. You can list functions from the current folder using ':l filename'. The file can be reloaded using ':r'
|
||||
|
||||
I got Haskell installed and set up the Haskell Language Server for Neovim. That took a little bit more effort than anticipated but eventually I got it to work. My Lua files are so fucked. ChatGPT helped a lot though.
|
||||
|
||||
[^1]: not really Rust, because I believe Rust has functional programming support.
|
||||
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
module Main where
|
||||
|
||||
-- A simple function that calculates the sum of a list of numbers.
|
||||
sumList :: [Int] -> Int
|
||||
sumList xs = foldl (+) 0 xs
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
let numbers = [1, 2, 3, 4, 5]
|
||||
-- Intentional error: 'numers' is misspelled to test error detection.
|
||||
print (sumList numbers)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user