design help

43 views
Skip to first unread message

Julien Viet

unread,
May 9, 2015, 4:31:59 AM5/9/15
to ceylo...@googlegroups.com
Hi,

I would like to refactor a generic declaration in ceylon.promise and I’m not good enough in generics to achieve it by myself.

Here is the thing:

the Completable<Value> interface declares something that can be completed and Value satisfies Anything[]
the Term interface satisfies Completable and provide composability (and operation)
the Promise interface satisfies Term<Value, [Value]> : it is a Term of a single value

At the moment the Completable<Value> interface needs to declare the constraint that Value satisfies Anything[] in order to make the composability work.

Do you think that we could remove this constraint from the Completable and change somehow the Term to achieve that ?

-- 
Julien Viet
www.julienviet.com

ps : the source code can be found here for more details https://github.com/ceylon/ceylon-sdk/tree/master/source/ceylon/promise

Julien Viet

unread,
May 9, 2015, 11:58:57 AM5/9/15
to ceylo...@googlegroups.com
so the issue are the methods that takes Callable<Result, Value> as argument I think.

so actually I refactored to simplify the design.

-- 
Julien Viet
www.julienviet.com
Reply all
Reply to author
Forward
0 new messages