[<<][staapl][>>][..]
Thu Jun 19 22:08:06 CEST 2008

data types + HOF

So, along the lines of
http://www.randomhacks.net/articles/2007/02/10/map-fusion-and-haskell-performance

The basic idea is: whenever you define a data type and a
map/fold/... HOF you need to somehow obtain transformation rules to
simplify compositions, by moving operations inside loops.

The problem is, mapping this to Purrr, it's quite easy to add these
transformation rules (manually), but the problem is really the
representation of the data type. How to add the runtime support for
say a video frame?

It is also pretty clear that typing is essential here: i'd really like
'+' to be polymorphic, so i can make every occurence of 'map'
implicit. Functions should be upgraded (coerced?) automatically.

I'm getting confused now.. Polymorphic macros. Is assembly pattern
matching a genuine type system?


Just had a look at the wikipedia C++ template page, and it says:

   a feature of the C++ programming language that allow code to be
   written without consideration of the data type with which it will
   eventually be used

It looks like what i'm doing is more general that that (compile time
decisions based on literal values), but on the other hand, you can
probably hide everything that can be done with values in Purrr, in
classes in C++.

Maybe this is an essential difference really: value based
metaprogramming instead of type based? Does this make sense at all?
( Objects instead of classes? Prototype templates? )




[Reply][About]
[<<][staapl][>>][..]