You could I suppose have a polymorphic type and pass in ‘void’. I had an idea 
for something here: http://blog.vmchale.com/article/ann 
<http://blog.vmchale.com/article/ann>

In ATS I guess it would be

datatype Impossible

datatype A(phantom: type) = A | B | C of (phantom)

Then A(Impossible) would be sort of like a subtype of A(void) or at least you 
could manipulate it like that.

I’m not sure such a solution is worth it though! Might be better to just RTFM :P

Cheers,
Vanessa McHale

> On Feb 8, 2022, at 5:47 PM, Raoul Duke <rao...@gmail.com> wrote:
> 
> hi, a scenario 
> 
> enum of n values. 
> api function that takes the enum. 
> but throws error for some subset of enum values. 
> 
> how could we statically be told, enforce do not call the api fn in those 
> cases?
> 
> besides "rtfm". 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ats-lang-users+unsubscr...@googlegroups.com 
> <mailto:ats-lang-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ats-lang-users/CAJ7XQb7erubNjQotU8ap_J4_4Eaks%2B%3DDabqyZU6jeRnGMYGf7w%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/ats-lang-users/CAJ7XQb7erubNjQotU8ap_J4_4Eaks%2B%3DDabqyZU6jeRnGMYGf7w%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/6E3FE33B-F1BA-4703-BEEB-0F09DFB2C5FF%40gmail.com.

Reply via email to