ansible/dhall/Prelude/List/head.dhall

11 lines
260 B
Text
Raw Normal View History

2024-11-26 05:55:44 +00:00
--| Retrieve the first element of the list
let head
: ∀(a : Type) → List a → Optional a
= List/head
let example0 = assert : head Natural [ 0, 1, 2 ] ≡ Some 0
let example1 = assert : head Natural ([] : List Natural) ≡ None Natural
in head