I’m looking at Erlang code (specifically the brod library for Kafka) and I’m puzzled by the type declarations. I see lines like this:
-type cg() :: #brod_cg{}.
which I assume means “cg is a map”. But I don’t know why its got the name in front of it. Is that actually providing anything for the type system? This is as opposed to something like this that makes more sense to me (since its declaring keys and the types of values for those keys).
-type fold_limits() :: #{ message_count => pos_integer()
, reach_offset => offset()
}.