commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: [functor] Change default arity of Function, Predicate and Procedure
Date Wed, 13 Feb 2013 16:24:57 GMT
Hi Jorg,
  We had at some point talked about whether these could be done with a
simple annotation.  I had hoped for something that could be expressed in
terms enforceable by the compiler.

Matt


On Wed, Feb 13, 2013 at 10:22 AM, Jörg Schaible <Joerg.Schaible@scalaris.com
> wrote:

> Hi,
>
> Matt Benson wrote:
>
> > TBH, I can't recall what the argument was against "Functor" either; I
> > think it had something to do with potentially confusing users of other
> > libraries?
> >
> > Functor
> > |_NullaryFunctor
> > |_UnaryFunctor
> > |_BinaryFunctor
> >
> > *is* the current state.  :)  Now, when I woke up this morning I did so
> > with another concept floating around in my brain (it may be crazy, or not
> > work):
> >
> > interface Arity {
> > }
> >
> > interface Argumented<A extends Arity> {
> > }
> >
> > interface Unary<A> extends Arity {
> > }
> >
> > interface UnaryFunction<A, T> extends Argumented<Unary<A>> {
> > }
> >
> > Bear in mind the goal is to be able to inspect the type of a functor to
> > determine its arity (momentarily disregarding the fact that this goal is
> > seeming less worth the trouble all the while :P ).  This approach would
> > make that a bit more complex, but still seemingly doable.
> >
> > Thoughts?
>
> @Arity(0)
> interface NullaryFunctor {
> }
>
> @Arity(1)
> interface UnaryFunctor {
> }
>
> @Arity(2)
> interface BinaryFunctor {
> }
>
> Crazy enough? ;-)
>
> Do those interfaces need an ancestor?
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message