Re: Is a function a relation?
Date: Tue, 23 Jun 2009 20:34:24 -0700 (PDT)
On Jun 23, 8:15 pm, Marshall <marshall.spi..._at_gmail.com> wrote:
> On Jun 22, 10:35 pm, David BL <davi..._at_iinet.net.au> wrote:
> Consider the case of composition. It gets quite complicated!
> But the complication is all on the shoulders of the type system
> implementer. The programmer will be much happier that
> way than if we introduce nesting and special conventions, etc.
Oh, and don't forget that we probably need different treatment for total vs. partial functions, and we'd probably also like to get in catamorphisms/generators/multifunctions (or whatever you want to call them) and also anamorphisms/folds/stream functions. And consider that a predicate is a restricted form of multifunction that we probably also want special treatment for.
Be sure your types system handles all of these, and all possible compositions of these, soundly.
Don't forget that if your stream function is a fold of a binary function that is both commutative and associative, ("in AC") you can compose it with an extensional relation nicely, but if the function is not in AC, then composing it with a relation introduces nondeterminism!
Marshall Received on Wed Jun 24 2009 - 05:34:24 CEST