From ea530aa44c67169e83ec94af715f7373b328524e Mon Sep 17 00:00:00 2001 From: Sebastian Steger Date: Fri, 14 Nov 2025 13:50:46 +0100 Subject: [PATCH] expanded haskell lists --- haskell/01-expressions/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/haskell/01-expressions/README.md b/haskell/01-expressions/README.md index ce20458..4386335 100644 --- a/haskell/01-expressions/README.md +++ b/haskell/01-expressions/README.md @@ -85,13 +85,15 @@ Expression | Type (:t) | Value | Comment Expression | Type (:t) | Value | Comment --- | --- | --- | -------- -`[1,7,4]` | `Num a => [a]` | `[1,7,4]` | `[]` | `[a]` | `[]` | -`8 : [1,7,4]` | `Num a => [a]` | `[8,1,7,4]` | **cons** operator, short for construct `1:7:4:[]` | `Num a => [a]` | `[1,7,4]` | actual construction of a list -`[1,7,4] ++ [8]` | `Num a => [a]` | `[1,7,4,8]` | -`(++)` | `[a] -> [a] -> [a]` | | +`[1,7,4]` | `Num a => [a]` | `[1,7,4]` | +`8 : [1,7,4]` | `Num a => [a]` | `[8,1,7,4]` | **cons** operator, short for construct `[1,7,4]` | `[Num a] => [a]` | `[1,7,4]` | +`(++)` | `[a] -> [a] -> [a]` | | +`[1,7,4] ++ [8]` | `Num a => [a]` | `[1,7,4,8]` | +`[1,7,4] !! 2` | `Num a => [a]` | `4` | +`(!!)` | `[a] -> Int -> a` | | `head [1,7,4]` | `Num a => a` | `1` | Similar `last` `tail [1,7,4]` | `[Num a] => [a]` | `[7,4]` | Similar `init` `length [1,7,4]` | `Int` | `3` |