# How to detect/avoid type piracy?

**URL:** https://discourse.julialang.org/t/how-to-detect-avoid-type-piracy/114588
**Category:** General Usage
**Created:** [May 22, 2024, 5:31pm UTC](https://discourse.julialang.org/t/how-to-detect-avoid-type-piracy/114588 "2024-05-22T17:31:49Z")
**Posts on this page:** 1
**Showing post:** 36

<div class="post-metadata">

### Author: ![vvbond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vvbond/32/10105_2.png) [@vvbond](https://discourse.julialang.org/u/vvbond)
#### Post date: [May 24, 2024, 2:27pm UTC](https://discourse.julialang.org/t/how-to-detect-avoid-type-piracy/114588/36 "2024-05-24T14:27:20Z")

</div>

Hmm. Thank you for the nice write-up. I think I begin to understand your point better.

However, your example sets perfect ground for counter argument. Being able to put the `most_interesting_operation` under the same roof would allow developers to write something like:

```julia
map(most_interesting_operation, bag_of_vars)

```

that would work for any collection of variables whose types might not be even known in advance until run time.

Even better, I can write something like

```julia
twice_as_interesting(x) = x |> most_interesting_operation |> most_interesting_operation

```

And this will just work for all types for which the corresponding specialisation is exported. This is generic!

With the `most_interesting_operation`s confined to their respective modules, the above becomes utterly impossible, isn’t it?

---

_[View the full topic](https://discourse.julialang.org/t/how-to-detect-avoid-type-piracy/114588)._
