What's the meaning of `'a` in ReScript?

Putting it as a question here because I am not sure what exactly is this called ? I am a newbie to ReScript and many of it’s paradigms are new to me. In some of the codebases, I see the use of a quote before an identifier i.e. type<'a>.

Can anyone explain what that ' before a stands for ? Since I don’t know what that is, can’t exactly search for it in the docs.

It means it’s a type variable (i.e. a generic type). If you know TypeScript, where it would use Array<T>, ReScript would use array<'a>. You can pronounce it as ‘tick a’ or ‘alpha’ if you prefer.

4 Likes