Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Operator Overloading

Name: Anonymous 2007-08-19 22:01 ID:cGHmVo4b

What are your opinions? Use or don't use?

Name: Anonymous 2009-11-13 13:05

>>34
operator overloading is a nonessential feature preserved for the benefit of the programmer
As is everything, really. You can choose to program in machine code, I'll invent some new operators in Haskell.

(~>) :: a -> (a -> b) -> b
infixl ~>
(~>) = flip ($)

data Person = Person {
              address :: Address
            , age :: Integer
            } deriving (Show)

data Address = Address {
               street :: String
             , house :: Integer
             } deriving (Show)


And now given p :: Person you can do
p~>address~>street
OOP IN HASKELL

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List