Map-like structure but using enum variants

I’m building a simple anime tracker for myself (yes, I know MyAnimeList is a thing), but I’ve encountered a weird situation here.

I have 3 anime statuses right now (Tracking, Watching and Completed), but I also need a way to store their count, however, I have seen that something like {Anime.Status.t: int} (like I would do in jsland) is not allowed and there is no good ways of building something alike.

Is there any suggestions on how to fix this issue?

If it’s just about mapping status → count, you could use a regular JS map:

type status = Tracking | Watching | Completed

let m = Map.make()

m->Map.set(Watching, 1)
2 Likes