[felix] #12: implement functors

0 views
Skip to first unread message

felix

unread,
May 12, 2007, 1:54:07 AM5/12/07
to felix-...@googlegroups.com
#12: implement functors
-------------------------+--------------------------------------------------
Reporter: erickt | Owner:
Type: enhancement | Status: new
Priority: major | Milestone:
Component: type system | Version:
Keywords: |
-------------------------+--------------------------------------------------
We've got a keyword for functors, but we don't actually support them yet.
One way to do it without needing the "functor" keyword would be to
implement functors as arguments to a module, like this:

{{{
module Foo (x:module_interface) {
typedef t = x.t;
...
}
}}}

from skaller:

Good idea. What's an interface? Hmm .. how about a typeclass?

{{{
module Foo[t with Eq[t]] { f(x:t) .... }
}}}

Implementation ..

{{{
f[t with Eq[t]] (x:t) ..
}}}

Oh wait .. that should work right now! Or close to it.

Hmm.. or:

{{{
module Foo (X) { typedef t = X::t; }
}}}

Something I've been thinking of is 'typesafe' macros aka templates.

They're just C++ templates, that is, they bind to the
context of use.

We do sort of have this with 'reduce .. ' but only
for expressions. There's no 'reduce' for statements.

--
Ticket URL: <http://code.felix-lang.org/ticket/12>
felix <http://code.felix-lang.org>
The advanced scripting language

felix

unread,
Mar 17, 2010, 4:06:38 PM3/17/10
to felix-...@googlegroups.com
#12: implement functors
-------------------------+--------------------------------------------------
Reporter: erickt | Owner:
Type: enhancement | Status: new
Priority: major | Milestone:
Component: type system | Version:
Keywords: |
-------------------------+--------------------------------------------------

Comment(by godvin):

visit these sites for meeting - [http://putana001.co.cc]
[http://putana002.co.cc] [http://putana003.co.cc] [http://putana004.co.cc]
[http://putana005.co.cc] just be careful! ?????? ?? ?????? :)

--
Ticket URL: <http://code.felix-lang.org/ticket/12#comment:1>

Reply all
Reply to author
Forward
0 new messages