Gets the first element of the list.
The source list.
The first element of list if exists.
expect(head(empty())).toStrictEqual(Option.none());expect(head(fromString("hoge"))).toStrictEqual(Option.some("h"));const list = singleton(42);expect(head(list)).toStrictEqual(Option.some(42));expect(head(list.rest())).toStrictEqual(Option.none()); Copy
expect(head(empty())).toStrictEqual(Option.none());expect(head(fromString("hoge"))).toStrictEqual(Option.some("h"));const list = singleton(42);expect(head(list)).toStrictEqual(Option.some(42));expect(head(list.rest())).toStrictEqual(Option.none());
Gets the first element of the list.