1
0
Fork 0

Merge remote-tracking branch 'origin/haskell-expressions' into haskell

main
Sebastian Steger 2025-11-17 08:10:40 +01:00
commit 05a3ea30d6
1 changed files with 6 additions and 4 deletions

View File

@ -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` |