code: function listToArray(list) {
    if(isFunction(list)) {
      return function(x) {
        const m = list(x)
  
        if(!isSameType(List, m)) {
          throw new TypeError('listToArray: List returning function required')
        }
  
        return m.toArray()
      }
    }
  
    if(isSameType(List, list)) {
      return list.toArray()
    }
  
    throw new TypeError('listToArray: List or List returning function required')
  }
docs: listToArray : List a -> [ a ] listToArray : (a -> List b) -> a -> [ b ]