Open DaQuirm opened 4 years ago
In addition to the safe version of the head function write the following list functions using Maybe for the return type in order to make them safe:
head
Maybe
tail — returns all the elements after the head of a list init — returns all the elements but the last one last — returns the last element
tail
init
last
In addition to the safe version of the
head
function write the following list functions usingMaybe
for the return type in order to make them safe:tail
— returns all the elements after the head of a listinit
— returns all the elements but the last onelast
— returns the last element