Re: Spad and inductive types
Gabriel Dos Reis <[email protected]>
| Newsgroups | gmane.comp.mathematics.axiom.user |
|---|---|
| Organization | Texas A&M University, Department of Computer Science |
| Message-ID | <[email protected]> |
Martin Rubey <[email protected]> writes: | Here you go. But I doubt somehow that Gaby had this in mind, since this is | quite usual stuff in Axiom (grep "Rep.*Union") Thanks, Martin. I did not say I did not know how to write it. I said "I don't have a good way" :-). Everything I've tried to come up (including proposed solutions here) with looked a hack to me. Part of the reasons is -- MkAdd ==> Record(lAdd:%,rAdd:%) -- MkMul ==> Record(lMul:%,rMul:%) if union are used whose fields are directly records, then the fields of the record must themselves have different name. In the Boot or Haskell case, only the data constructor name need to be different. I fully understand Spad is not Haskell, neither Boot, but I'm looking for a solution where only the toplevel data constructors needs to be different. I have more to say later. -- Gaby