Add equivelent to Head and Tail in functional languages