I’ve written a post on how I’ve designed and implemented an advanced (with regards to the types) library here, using elm-codec as an example of how to think with more abstract/generic types.
I hope it can help someone looking to understand where those types come from.