I have an intuitive understanding of behaviours and protocols of course, but after talking with a colleague today, I was surprised that behaviours and protocols are kind of the same thing.
Mainly because protocols are like type classes in Haskell, and if I squint, behaviours are also.
Which you know, is comforting, as I always like seeing links between data (protocols) and code / actions (behaviours).
But, where am I going wrong?
Can anyone explain these Elixir concepts in terms of Haskell, maybe a bit more precision will show me where I am going wrong…
Could I create a GenServer protocol? Or is that completely ridiculous?
I see a related link which is interesting: Why is Access a behaviour instead of a Protocol? When to use a Protocol instead of a Behaviour?