Question: I have installed a npm module (`react-native-mobx`) that ships with its types. This is the files from the node\_modules directory:

[![enter image description here](https://i.stack.imgur.com/pQnS6.png)](https://i.stack.imgur.com/pQnS6.png)

Pay attention to the highlighted `mobx.d.ts` file which contains the types. I have typescript 2.2.2 installed. And as I now, types are now contained in the `@types` folder, inside the node\_modules. In this case, how do I reference this library in my code and have normal intellisence? Should I create a folder '`react-native-mobx`' inside `@types`and copy the mobx.d.ts in there and change its name to index.d.ts?

Thank you for your help.

Answer: 
Because the suggested duplicates answer most of this, I will focus on the questions in your followup comment.

> 
> 1) why is the standard implementation for fixed n = 2
> 
> 
> 

`zipWith` is for 2 arguments, and `repeat` is for 0 arguments. This is enough to get arbitrary-arity zips. For example, the 1 argument version (also called `map`) can be implemented as

```
map f = zipWith ($) (repeat f)

```

and the 3 argument version as

```
zipWith3 f = (.) (zipWith ($)) . zipWith f

```

and so on. There is a pretty pattern to the implementations of larger zips (admittedly not obvious from this small sample size). This result is analogous to the one in CT which says that any category with 0-ary and 2-ary products has all finitary products.

The other half of the answer, I suppose, is that type-level numbers (which are the most frequent implementation technique for arbitrary-arity zips) are possible but annoying to use, and avoiding them tends to reduce both term- and type-level noise.

> 
> 2) I need to pass the number of lists, that's unwieldy
> 
> 
> 

Use `ZipList`. You don't need to pass the number of lists (though you do need to write one infix operator per list -- a very light requirement, I think, as even in Python you need a comma between each list).

Empirically: I have not found arbitrary-arity zips such a common need that I would label it "unwieldy".

> 
> 3) even if I define my own zip, there will be collisions with Prelude.zip.
> 
> 
> 

So pick another name...?
Because the type signatures would be different, for example the type signatures of zip and zip3 are different:

`zip :: [a] -> [b] ->[(a,b)]`

`zip3:: [a] -> [b] -> [c] -> [(a,b,c)]`

`zip3` takes one more argument than `zip` and secondly the type, and haskell does not allow you to have a polymorphism with different numbers of arguments because of currying. [Here](https://stackoverflow.com/questions/36314/what-is-currying) is an explanation of what currying is on SO.