Re: [m-users.] Compiler cannot infer determinism det when exhaustively pattern matching on a constant?
Anders Lundstedt <[email protected]> Wed, 31 Jul 2024 22:14:15 +0200
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <CANGMbaZXr+Jvkp-_Y0Jvc9XE2bYP-40tG2gNbRUZBTB3azcH6g@mail.gmail.com> |
For whatever it is worth, another workaround (turning the constant into a constant function): :- module test. :- interface. :- type t ---> c1; c2. :- pred p(t::out) is det. :- implementation. :- func c(t) = t. c(_) = c1. p(A) :- c(c1) = C, ((C = c1, A = c2) ; (C = c2, A = c1)). _______________________________________________ users mailing list [email protected] https://lists.mercurylang.org/listinfo/users