🔤Haskell
Also known as Haskell Language, Haskell Programming
A language where code works like maths and types are checked first.
Think of it like
It is like a maths book that a computer can run.
Example
Lucy writes a function to square a number in Haskell, then maps it over a list. The result is [1,4,9].
Why it matters
Many ideas in newer languages were tried in Haskell first. Map and pattern matching are two of them.
Definition
Example code
haskell
square x = x * x
main = print (map square [1, 2, 3]) -- [1,4,9]Common mistake
Key takeaways
- 1Pure functions. Same input, same output.
- 2Strong types. Checked before it runs.
- 3Lazy. Work is done only when needed.