forked from steger/pr3-sose2026
expanded haskell lists
parent
8da0378153
commit
ea530aa44c
|
|
@ -85,13 +85,15 @@ Expression | Type (:t) | Value | Comment
|
||||||
|
|
||||||
Expression | Type (:t) | Value | Comment
|
Expression | Type (:t) | Value | Comment
|
||||||
--- | --- | --- | --------
|
--- | --- | --- | --------
|
||||||
`[1,7,4]` | `Num a => [a]` | `[1,7,4]` |
|
|
||||||
`[]` | `[a]` | `[]` |
|
`[]` | `[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:[]` | `Num a => [a]` | `[1,7,4]` | actual construction of a list
|
||||||
`[1,7,4] ++ [8]` | `Num a => [a]` | `[1,7,4,8]` |
|
`[1,7,4]` | `Num a => [a]` | `[1,7,4]` |
|
||||||
`(++)` | `[a] -> [a] -> [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]` |
|
`[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`
|
`head [1,7,4]` | `Num a => a` | `1` | Similar `last`
|
||||||
`tail [1,7,4]` | `[Num a] => [a]` | `[7,4]` | Similar `init`
|
`tail [1,7,4]` | `[Num a] => [a]` | `[7,4]` | Similar `init`
|
||||||
`length [1,7,4]` | `Int` | `3` |
|
`length [1,7,4]` | `Int` | `3` |
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue