simulating typeclasses in ATS

93 views
Skip to first unread message

whyu

unread,
Mar 18, 2020, 8:35:29 AM3/18/20
to ats-lang-users
Are there any sensible ways of simulating typeclasses in ATS? I could define typeclass dictionaries explicitly and manually passing it around, but that would defeat the whole purpose of using typeclasses which is to let the compiler choose the dictionary for me. I could also use function templates but I don't know how to make them explicit in type signatures(unlike typeclass constraints).

gmhwxi

unread,
Mar 19, 2020, 4:52:44 PM3/19/20
to ats-lang-users
There is no need to simulate typeclasses in ATS.

To some extent, the templates in ATS are like typeclasses on steroids :)

If you'd like to have a feel for the power of templates, please take a look at
ATS-Temptory:


Or you can wait for ATS3 to become ready.

Vanessa McHale

unread,
Mar 25, 2020, 6:48:06 PM3/25/20
to ats-lang-users

They're suitable where typeclasses are as far as I can tell (I am not familiar with the type theory)

Cheers,
Vanessa McHale
Reply all
Reply to author
Forward
0 new messages