Re[2]: [Haskell-cafe] Interesting Thread on OO Usefulness (scala mailing list)

2009-05-05 Thread Bulat Ziganshin
Hello Wolfgang,

Tuesday, May 5, 2009, 8:27:17 PM, you wrote:

 i know two problems in Haskell/GHC that require OO-loke features -
 extensible exceptions and GUI widget types hierarchy

 Note that you don’t need different types for different kinds of GUI widgets if
 you use Functional Reactive Programming (FRP). You need different types if
 you use OO because you have to explicitely modify widgets after you have
 created them, and what modifications you are allowed to do, depends on the
 kind of widget. With FRP, you specify the behavior over all time when you
 create the widget, so no need for later method calls.

(i don't know anything about FRP)

i think it doesn't change anything. the main reason why i need common
operations is because i write generic procedures. another erason os
what i can't remember 100 individual 'setSize' operations for 100
types of widgets. so we need to have some generic names, short of they
are used due initialization or later

-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] Interesting Thread on OO Usefulness (scala mailing list)

2009-05-04 Thread Bulat Ziganshin
Hello Mads,

Monday, May 4, 2009, 7:01:16 PM, you wrote:

 i know two problems in Haskell/GHC that require OO-loke features -
 extensible exceptions and GUI widget types hierarchy

 Yes, type hierarchies require OO.

 But, do we really need to represent different widget-types in a
 hierarchy?

 An alternative to a big hierarchy would be to let different widget-types
 implement different type classes. We could have type classes like
 MouseEvents, KeyboardEvents, Activated, ...

there is obvious difference between OOP and type class hierarchies -
OOP ones includes data fields. (somewhat close functionality provided
by extensible records, but they are not in GHC nor provide strong
type-checking)

this means a lot of boilerplate code written, i.e. we lose compared to
OOP


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe