
On Thu, May 15, 2014 at 11:37:40PM +0200, silvio wrote:
In what languages is (.) cool, and in what way?
Because depending on what is before it, what is behind it can have different meanings. For me this is one of the main points. I just don't like the name collision problem in Haskell. Take something like size for instance it is pretty clear what it means yet unless you have a type class that everybody knows about you can use it on only one thing. And even if you have a simple type class some object might want to return an Int and some other might want to return an Integer. With (.) being from a multiparameter typeclass you can define for each object what it means without any of them knowing about the others. And you are not even limited to, let's call them, 'labels' like size. You can also use any other Type you want like the key of a database object or as in my example a Map.
So, slightly simplified you want to: Firstly, a notation where you put the first argument before the function/method? [1,2,3] . length -> 3 Secondly, mimic the multilayered namespaces that is commonly found in mainstream imperative OO languages? [1,2,3] . length -> 3::Int aPieceOfString . length -> 120.0::Double Just trying to understand what problem you are actually trying to solve. I've *never* thought of (.) being powerful in OO languages, mostly because I don't really think the dot is what makes an OO language. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus What gets measured, gets done. -- Tom Peters