top of page

List

Lists are very similar to their representation in Haskell. The : operator can be used to append elements at the front of the list.

​

> 1 : [2] 

[1, 2]

​

The <- operator can be used to append elements at the end of the list.

> [1] <- 2 

[1, 2]

​

An item in a list can be accessed at a particular index (starting from 0) using the !! operator

​

> [1, 2, 3] !! 1

2

bottom of page