commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@scalaris.com>
Subject Re: [functor] Change default arity of Function, Predicate and Procedure
Date Wed, 13 Feb 2013 16:22:25 GMT
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
View raw message