code: function arrayToList(array) {
    if(isArray(array)) {
      return List.fromArray(array)
    }
    else if(isFunction(array)) {
      return function(x) {
        const g = array(x)
  
        if(!isArray(g)) {
          throw new TypeError('arrayToList: Array returning function required')
        }
  
        return List.fromArray(g)
      }
    }
  
    throw new TypeError('arrayToList: Array or Array returning function required')
  }
docs: arrayToList : [ a ] -> List a arrayToList : (a -> [ b ]) -> a -> List b