On Sat, 2007-02-10 at 16:41 +0100, Rhythmic Fistman wrote:
> > Another introduction like by many is Cale Gibbard's
> > http://haskell.org/haskellwiki/Monads_as_containers
>
>
> Thanks, I like the fruity example too.
> So, which parts of felix are "functorial"?
GAK! That's like asking which parts of the ocean are wet!
Polymorphic types are functors: more precisely polymorphic
type constructors are functors. For example:
typedef fun pair(t:TYPE):TYPE => t * t;
is a functor from category TYPE to category TYPE.
Although this formula only maps the category objects,
the implied mapping of arrows (functions) is that
fun f[t,u]: t -> u
maps to
fun g[t,u](x:t, y:t): u * u = f x, f y
that is, just element-wise application. It is obvious
that this is structure preserving: given two functions:
h: a -> b
k: b -> c
then
F ( k . h ) = F k . F h
Lots of other things are functors too. For example typeclass
instances are required to be functors .. programming languages
are awash with functors!
[I hope i got this right .. :]
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language