export function cons < T > ( head , rest ) { return [ head ] . concat ( rest ) ; } export function head < T > ( list ) { return list [ 0 ] ; } export function rest < T > ( list ) { return list . slice ( 1 ) ; }