From 11f2b923197d961e4115d6361399ddd20c643fe2 Mon Sep 17 00:00:00 2001 From: Dane Sabo Date: Wed, 19 Feb 2025 11:50:56 -0500 Subject: [PATCH] vault backup: 2025-02-19 11:50:56 --- 3-99 Research/Haskell/Chapter 1 - Introduction.md | 2 ++ 3-99 Research/Haskell/main.hs | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/3-99 Research/Haskell/Chapter 1 - Introduction.md b/3-99 Research/Haskell/Chapter 1 - Introduction.md index 115a21b5f..6da35e888 100644 --- a/3-99 Research/Haskell/Chapter 1 - Introduction.md +++ b/3-99 Research/Haskell/Chapter 1 - Introduction.md @@ -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. diff --git a/3-99 Research/Haskell/main.hs b/3-99 Research/Haskell/main.hs index e69de29bb..36a645c33 100644 --- a/3-99 Research/Haskell/main.hs +++ b/3-99 Research/Haskell/main.hs @@ -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) +