write literate haskell programs in typst cdn.oppi.li/typst-unlit.pdf
haskell typst
at main 455 B view raw
1= Quicksort in Haskell 2The first thing to know about Haskell's syntax is that parentheses 3are used for grouping, and not for function application. 4 5```haskell 6quicksort :: Ord a => [a] -> [a] 7quicksort [] = [] 8quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) 9 where 10 lesser = filter (< p) xs 11 greater = filter (>= p) xs 12``` 13 14The parentheses indicate the grouping of operands on the 15right-hand side of equations. 16