[Haskell-cafe] Object oriented haskell.

silvio silvio.frischi at gmail.com
Thu May 15 22:47:40 UTC 2014


> 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.

That's essentially it. I see that people on this thread where thinking
more along the lines of inheritance. So let me add that it shouldn't be
difficult to add the instances you want for your child object and then
make a default instance which reverts to the parent object. It's a bit
of a problem for updating stuff in a functional way since you can never
be sure if a method is ment to return an object or if this is supposed
to be an update. But for things in IO/STM/... it should be fine.

Silvio



More information about the Haskell-Cafe mailing list