(self: List<A>)
| 233 | * @category getters |
| 234 | */ |
| 235 | export const size = <A>(self: List<A>): number => { |
| 236 | let these = self |
| 237 | let len = 0 |
| 238 | while (!isNil(these)) { |
| 239 | len += 1 |
| 240 | these = these.tail |
| 241 | } |
| 242 | return len |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * Constructs a new empty `List<A>`. |