Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eksperimental/701103fc9e723fddc0bfeb757ecb1e7d to your computer and use it in GitHub Desktop.
Save eksperimental/701103fc9e723fddc0bfeb757ecb1e7d to your computer and use it in GitHub Desktop.
What modules implement the Enumerable and Collectable protocols in Elixir
Collectable
elixir$ ag "defimpl\s+Collectable" -G ".ex$"
HashDict
lib/elixir/lib/hash_dict.ex
247:defimpl Collectable, for: HashDict do
IO.Stream
lib/elixir/lib/io/stream.ex
35: defimpl Collectable do
File.Stream
lib/elixir/lib/file/stream.ex
37: defimpl Collectable do
MapSet
lib/elixir/lib/map_set.ex
366: defimpl Collectable do
List
BitString
Map
lib/elixir/lib/collectable.ex
80:defimpl Collectable, for: List do
90:defimpl Collectable, for: BitString do
100:defimpl Collectable, for: Map do
HashSet
lib/elixir/lib/hash_set.ex
258:defimpl Collectable, for: HashSet do
--------
Enumerable
elixir$ ag "defimpl\s+Enumerable" -G ".ex$"
Stream
lib/elixir/lib/stream.ex
1382:defimpl Enumerable, for: Stream do
HashDict
lib/elixir/lib/hash_dict.ex
223:defimpl Enumerable, for: HashDict do
IO.Stream
lib/elixir/lib/io/stream.ex
52: defimpl Enumerable do
List
Map
Function
lib/elixir/lib/enum.ex
3128:defimpl Enumerable, for: List do
3141:defimpl Enumerable, for: Map do
3164:defimpl Enumerable, for: Function do
Range
lib/elixir/lib/range.ex
78:defimpl Enumerable, for: Range do
GenEvent.Stream
lib/elixir/lib/gen_event/stream.ex
49:defimpl Enumerable, for: GenEvent.Stream do
File.Stream
lib/elixir/lib/file/stream.ex
69: defimpl Enumerable do
MapSet
lib/elixir/lib/map_set.ex
360: defimpl Enumerable do
HashSet
lib/elixir/lib/hash_set.ex
238:defimpl Enumerable, for: HashSet do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment