[Haskell-cafe] Mancunian Haskellers out there?
Morning Cafe, I've been living in Manchester for 1 month now and I'm wondering if some on you are from the Greater Manchester area, so that we could chat about out beloved language in front of a glass of ale / tea :P Happy new year to everyone! A. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Mancunian Haskellers out there?
Greetings, I'm currently residing in Bury, a metrolink ride away from Manchester. Unfortunately, I'm only here for Christmas holidays and am leaving tomorrow so a meeting is unlikely. I don't think that I'd be a good conversation partner anyway as my knowledge is still quite limited. I'd love to hear whether you find any other people though. It would be nice if some Haskell talks could be held in the area if there are enough people. Good luck on your search, Mateusz Kowalczyk On 30/12/12 14:38, Alfredo Di Napoli wrote: Morning Cafe, I've been living in Manchester for 1 month now and I'm wondering if some on you are from the Greater Manchester area, so that we could chat about out beloved language in front of a glass of ale / tea :P Happy new year to everyone! A. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Mancunian Haskellers out there?
Hey, thanks for the response :) Mine was more a small survey to see if we are enough to think about creating a small user group and see each other once a month or whenever :) Cheers, A. On 30 December 2012 15:58, Mateusz Kowalczyk fuuze...@fuuzetsu.co.ukwrote: Greetings, I'm currently residing in Bury, a metrolink ride away from Manchester. Unfortunately, I'm only here for Christmas holidays and am leaving tomorrow so a meeting is unlikely. I don't think that I'd be a good conversation partner anyway as my knowledge is still quite limited. I'd love to hear whether you find any other people though. It would be nice if some Haskell talks could be held in the area if there are enough people. Good luck on your search, Mateusz Kowalczyk On 30/12/12 14:38, Alfredo Di Napoli wrote: Morning Cafe, I've been living in Manchester for 1 month now and I'm wondering if some on you are from the Greater Manchester area, so that we could chat about out beloved language in front of a glass of ale / tea :P Happy new year to everyone! A. ___ Haskell-Cafe mailing listHaskell-Cafe@haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))
Hi, I also support Jon's proposal for standalone of { ... }. Seems to me clearer and more useful than the special \case construct. I suppose 'of { ... }' could be generalized to multiple arguments, so that of (Just x) (Just y) - x ++ y would create an anonymous function of type 'Maybe String - Maybe String - String'. Considering the recent thread about partial functions: http://www.haskell.org/pipermail/haskell-cafe/2012-December/105445.html we could have variants of 'of' to distinguish partial functions. For example, we could have something like 'ofFull' that would require an exhaustive list of patterns, and something like 'ofPart' that would instead produce results of type 'Maybe something'. (Most likely we'd have to think of better names for them.) For example: ofPart [x] [y] - x ++ y would be of type '[String] - [String] - Maybe String', returning `Nothing` if one of the input isn't a 1-element list - an approach similar to Scala's partial functions. http://www.scala-lang.org/api/current/scala/PartialFunction.html [Perhaps we could have 'of' to work both ways - if the list of patterns would be exhaustive, the result would be pure. If it would be non-exhaustive, the result would be 'Maybe something'. Of course 'case x of ...' would still work as now, not caring about exhaustiveness. But I'm not sure if this wouldn't be too error prone.] We could even generalize 'ofPart' to work with any Alternative instance so that ofPart [x] [y] - x ++ y would be of type '(Alternative f) = [String] - [String] - f String'. Matching patterns would return results using 'pure', non-matching 'empty', and they would be all combined combined using |. 'empty' would be returned if nothing matched. (Among other things, this could have some interesting consequences when overlapping patterns would be applied to 'Alternative []'.) For example fn = ofPart (Right 0) - 1 (Right x) - x would produce (using today's syntax): fn :: (Alternative f) = Either Bool Int - f Int fn x = case x of { Right 0 - pure 1 ; _ - empty; } | case x of { Right x - pure x ; _ - empty; } | empty Best regards, Petr 2012/12/29 Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk On Thu, Nov 29, 2012 at 05:49:53PM +, Jon Fairbairn wrote: Ben Franksen ben.franksen at online.de writes: just wanted to drop by to say how much I like the new lambda case extension. I use it all the time and I just *love* how it relieves me from conjuring up dummy variables, which makes teh code not only esier to write but also to read. [...] should *definitely* go into Haskell'13. [...] To me it seems obvious that if we are going to do this [...] we should do it simply by making the case exp part of a case expression optional. of {alts...} and we would then describe case e of {...} as syntactic sugar for (of {...}) (e) My very belated and unsolicited layman's reply is that I am a strong supporter of Jon's position. His suggestion is parsimonious and natural. Without wishing to start the discussion again, I disagree that it is bikeshedding. One lesson I learned from Haskell is that syntax is much more important than I previously realised. Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))
Jon's suggestion sounds great. The bike shed should be green. That is all. On Sun, Dec 30, 2012 at 4:44 PM, Petr P petr@gmail.com wrote: Hi, I also support Jon's proposal for standalone of { ... }. Seems to me clearer and more useful than the special \case construct. I suppose 'of { ... }' could be generalized to multiple arguments, so that of (Just x) (Just y) - x ++ y would create an anonymous function of type 'Maybe String - Maybe String - String'. Considering the recent thread about partial functions: http://www.haskell.org/pipermail/haskell-cafe/2012-December/105445.html we could have variants of 'of' to distinguish partial functions. For example, we could have something like 'ofFull' that would require an exhaustive list of patterns, and something like 'ofPart' that would instead produce results of type 'Maybe something'. (Most likely we'd have to think of better names for them.) For example: ofPart [x] [y] - x ++ y would be of type '[String] - [String] - Maybe String', returning `Nothing` if one of the input isn't a 1-element list - an approach similar to Scala's partial functions. http://www.scala-lang.org/api/current/scala/PartialFunction.html [Perhaps we could have 'of' to work both ways - if the list of patterns would be exhaustive, the result would be pure. If it would be non-exhaustive, the result would be 'Maybe something'. Of course 'case x of ...' would still work as now, not caring about exhaustiveness. But I'm not sure if this wouldn't be too error prone.] We could even generalize 'ofPart' to work with any Alternative instance so that ofPart [x] [y] - x ++ y would be of type '(Alternative f) = [String] - [String] - f String'. Matching patterns would return results using 'pure', non-matching 'empty', and they would be all combined combined using |. 'empty' would be returned if nothing matched. (Among other things, this could have some interesting consequences when overlapping patterns would be applied to 'Alternative []'.) For example fn = ofPart (Right 0) - 1 (Right x) - x would produce (using today's syntax): fn :: (Alternative f) = Either Bool Int - f Int fn x = case x of { Right 0 - pure 1 ; _ - empty; } | case x of { Right x - pure x ; _ - empty; } | empty Best regards, Petr 2012/12/29 Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk On Thu, Nov 29, 2012 at 05:49:53PM +, Jon Fairbairn wrote: Ben Franksen ben.franksen at online.de writes: just wanted to drop by to say how much I like the new lambda case extension. I use it all the time and I just *love* how it relieves me from conjuring up dummy variables, which makes teh code not only esier to write but also to read. [...] should *definitely* go into Haskell'13. [...] To me it seems obvious that if we are going to do this [...] we should do it simply by making the case exp part of a case expression optional. of {alts...} and we would then describe case e of {...} as syntactic sugar for (of {...}) (e) My very belated and unsolicited layman's reply is that I am a strong supporter of Jon's position. His suggestion is parsimonious and natural. Without wishing to start the discussion again, I disagree that it is bikeshedding. One lesson I learned from Haskell is that syntax is much more important than I previously realised. Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ghc and android
As suggested on the haskell beginners list, I am taking this to haskell-cafe. Hey, I know, this question has been asked in the past and there is a lot information one can find in the net. But in all of this information, I can not find definite answers for this. Is it currently possible to build haskell programs for android using the android NDK? If course, I know, bindings have to be written and android GUIs have to be written in Java. But if I would write the bindings for the things I need...? Via C/gcc? Its not the fastest, but should work, should it not? Via llvm? If not, what is the problem in doing this? Thank you! Nathan ___ Beginners mailing list beginn...@haskell.org http://www.haskell.org/mailman/listinfo/beginners ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Haskell-beginners] ghc and android
On 12/30/2012 03:43 PM, Brandon Allbery wrote: On Sun, Dec 30, 2012 at 8:19 AM, Nathan Hüsken nathan.hues...@posteo.dewrote: Is it currently possible to build haskell programs for android using the android NDK? If course, I know, bindings have to be written and android GUIs have to be written in Java. But if I would write the bindings for the things I need...? GUIs can be written without requiring Java/Dalvik, at least on the more recent versions of Android. It's the basic runtime support that is still a bit lacking, last I checked. Oh, cool. I did not know that. Via C/gcc? Its not the fastest, but should work, should it not? It's nonexistent for ARM; to get a working -fvia-C you have to go back to ghc versions that don't have any clue about ARM (if you want to scare yourself, check out via-C's Evil Mangler sometime). And I think the hosted build isn't working at the moment? Via llvm? I believe this is how current ARM development is doing it, rather than try to code up a native code generation backend. (I also get the impression that the NCGs are going to be deprecated in favor of -fllvm at some point, although they want to clean up some lingering optimization issues first; llvm wins for many things but does somewhat poorly for a few.) An additional issue: ghci (and Template Haskell because it uses the bytecode interpreter of ghci internally) currently(?) requires its own custom linker instead of being able to use the system linker. Said linker has no support for ARM. The correct fix for this is to redesign ghci so it doesn't need its own linker; there has been some work in this direction, but I don't know how complete it is, and it interacts with other issues such as building Haskell libraries as shared objects. With ghci, the consol haskell shell is meant, correct? I do not think I would need ghci on android, for what? I think I can live without template haskell. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Haskell-beginners] ghc and android
On Sun, Dec 30, 2012 at 1:46 PM, Nathan Hüsken nathan.hues...@posteo.dewrote: An additional issue: ghci (and Template Haskell because it uses the bytecode interpreter of ghci internally) currently(?) requires its own custom linker instead of being able to use the system linker. Said linker has no support for ARM. The correct fix for this is to redesign ghci so it doesn't need its own linker; there has been some work in this direction, but I don't know how complete it is, and it interacts with other issues such as building Haskell libraries as shared objects. With ghci, the consol haskell shell is meant, correct? Yes. (Actually, I think they got ghci working at some point, so this may not be relevant.) Also stuff like the hint and mueval libraries rely on the bytecode interpreter/ghci. I do not think I would need ghci on android, for what? I think I can live without template haskell. You can for a while, but you might be surprised what libraries use TH behind the covers. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Gloss and relatively expensive computations
Hi Artyom! Thanks for your response. It seems your tactic has worked. I was so focused on programming inside the gloss parameter that I completely forgot about programming in the outside. Here is what I did (I picked MVar's): myprog s = do ... var - newMVar w0 let loop w = do w' - step s w putMVar var w' loop w' forkIO $ loop w0 simulateIO ... (\_ _ w - fmap (fromMaybe w) $ tryTakeMVar var) And it's working just fine! Best regards, Daniel Díaz. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))
On Sun, Dec 30, 2012 at 8:51 AM, David Thomas davidleotho...@gmail.comwrote: Jon's suggestion sounds great. The bike shed should be green. There were plenty of proposals that would work fine. `case of` was great. `\ of` was great. It's less obvious to me that stand-alone `of` is never ambiguous... but if that's true, it's reasonable. Sadly, the option that was worse that doing nothing at all is what was implemented. The bikeshedding nonsense is frustrating. Bikeshedding is about wasting time debating the minutia of a significant improvement, when everyone agrees the improvement is a good idea. Here, what happened was that someone proposed a minor syntax tweak (from `\x - case x of` to `case of`), other reasonable minor syntax tweaks were proposed instead to accomplish the same goal, and then in the end, out of the blue, it was decided to turn `case` into a layout-inducing keyword (or even worse, only sometimes but not always layout-inducing). There is no bike shed here. There are just colors (minor syntax tweaks). And I don't get the use of bikeshedding as basically just a rude comment to be made at people who don't like the same syntax others do. -- Chris ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Object Oriented programming for Functional Programmers
Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. * Is it true that learning other programming languages leads to a better use of your favorite programming language? * Will I learn new programming strategies that I can use back in the Haskell world? Thanks in advance for your kind responses, Daniel Díaz. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
On Sun, 30 Dec 2012, Daniel D??az Casanueva dhelta.d...@gmail.com wrote: Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. There are several different things called object oriented programming. Here is what Alan Kay once said about C++: Actually I made up the term object-oriented, and I can tell you I did not have C++ in mind. Above quote from http://en.wikiquote.org/wiki/Alan_Kay [page was last modified on 30 November 2012, at 16:06] For me the most important things about objects are: 1. In the World of the Programming System there is a version of Lisp's eq?, ah that word is the Scheme word. 2. Really, objects are what are now called agents. The word inheritance does not appear in the first 600^W300 pages of my Ideal Textbook on the Theory of Objects in Programming. oo--JS. * Is it true that learning other programming languages leads to a better use of your favorite programming language? * Will I learn new programming strategies that I can use back in the Haskell world? Thanks in advance for your kind responses, Daniel D??az. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
Well, functional programmer is a relatively broad term. If you're coming from academia, so that for you Haskell is some sort of lambda-calculus, spoiled by practical aspects, then I'd suggest Luca Cardelli's book Theory of Objects. Also, as Daniel told you already, don't start from C++, it really has very little to do with OOP. It's primary merit is a very powerful system of macros (called templates in C++ world), not objects. If you want something mainstream, Java would be a good choice, and C# even better one (although it would be more convenient for you if you use Windows). Or you can try OCaml, which is functional enough for you not to feel lost, and object-oriented as well. Отправлено с iPad 30.12.2012, в 23:58, Daniel Díaz Casanueva dhelta.d...@gmail.com написал(а): Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. * Is it true that learning other programming languages leads to a better use of your favorite programming language? * Will I learn new programming strategies that I can use back in the Haskell world? Thanks in advance for your kind responses, Daniel Díaz. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
Sorry for the stupid mistake — when I said Daniel in the previous message, I've meant Jay. Отправлено с iPad 30.12.2012, в 23:58, Daniel Díaz Casanueva dhelta.d...@gmail.com написал(а): Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. * Is it true that learning other programming languages leads to a better use of your favorite programming language? * Will I learn new programming strategies that I can use back in the Haskell world? Thanks in advance for your kind responses, Daniel Díaz. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
I think it is always a good idea to learn languages that make your-favorite-paradigm hard. There are a lot of Aha moments to be had from forcing your brain to come at a problem from another angle. As for things to watch out for. There is a very strong duality between TypeClasses and existential polymorphism in OO. Both require a way to dynamically look up the correct implementation for the type you are operating upon. In Haskell we use Typeclasses which place this lookup table on the functions that have existential constraints on them. mconcat :: Monad m = [m] - m mconcat = foldl mappend [] We can think of `mconcat` having a little lookup table inside of itself, and whenever we pass it a concrete `[m]`, `mappend` gets looked up and we get the implementation for `m`. Typeclasses are just mappings from types to functions In OO on the other hand, the lookup table is attached to the datastructure. We can think of the Object as a mapping from function names to functions that operate on that Object. Python, Javascript, Ruby, and of course Smalltalk make this quite explicit. Aside from Object Orientation, it is probably a good idea to learn some C for a bit too. C is a good language to play in and try and implement more advanced language features. Once you reallize that objects are just lookup tables of functions bound with a data-structure, you can implement your own in C, or you can make closures as functions bundled with (some) of their arguments, or you can implement interesting datastructures, or so many other fun things. A good understanding of tagged unions has helped me in many a convo with an OO head. On Sun, Dec 30, 2012 at 11:58 AM, Daniel Díaz Casanueva dhelta.d...@gmail.com wrote: Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. * Is it true that learning other programming languages leads to a better use of your favorite programming language? * Will I learn new programming strategies that I can use back in the Haskell world? Thanks in advance for your kind responses, Daniel Díaz. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))
My 2 cents on the issue: We should have a better forms of meta-programming to solve this sort of issue generally. With the power of first-class functions and laziness, we can get away with a lot of things without meta-programming, but case expression syntax is not first class, so cannot benefit from the flexibility proffered to the rest of the language. tl;dr give me easily extensible syntax, rather than having to run to GHC devs every time I want a new or different flavor of sugar. -- Dan Burton ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))
Syntax extensibility is usually too powerful, it surely would be abused extensively, which would make developer's life a nightmare, unless there is only one developer and whole development takes no more than a couple of months. On Dec 31, 2012, at 1:09 AM, Dan Burton danburton.em...@gmail.com wrote: My 2 cents on the issue: We should have a better forms of meta-programming to solve this sort of issue generally. With the power of first-class functions and laziness, we can get away with a lot of things without meta-programming, but case expression syntax is not first class, so cannot benefit from the flexibility proffered to the rest of the language. tl;dr give me easily extensible syntax, rather than having to run to GHC devs every time I want a new or different flavor of sugar. -- Dan Burton ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
On Sun, Dec 30, 2012 at 3:45 PM, Eli Frey eli.lee.f...@gmail.com wrote: mconcat :: Monad m = [m] - m mconcat = foldl mappend [] We can think of `mconcat` having a little lookup table inside of itself, and whenever we pass it a concrete `[m]`, `mappend` gets looked up and we get the implementation for `m`. Typeclasses are just mappings from types to functions Except not quite... the Monad m = in the signature really means hey, compiler, pass me the appropriate implementation of Monad so I can figure out what I'm doing with this type m. It's not a built in table, it's a hidden parameter. Aside from Object Orientation, it is probably a good idea to learn some C for a bit too. C is a good language to play in and try and implement more advanced language features. Once you reallize that objects are just lookup tables of functions bound with a data-structure, you can implement your own in C, or you can make closures as functions bundled with (some) of their arguments, or you can implement interesting datastructures, or so many other fun things. A good understanding of tagged unions has helped me in many a convo with an OO head. A perhaps strange suggestion in this vein: dig up the source code for Xt, the old X11 Toolkit, and the Xaw widget library that is built atop it. (It's part of the X11 source tree, since most of the basic X11 utilities and xterm are based on it.) It implements a primitive object system in C. Gtk+ does the same, but hides much of the implementation behind macros and relies on tricky casting etc. behind the scenes for performance; in Xt, the basic machinery is more easily visible for inspection and much easier to understand even if you're not all that familiar with C. If you go this way, once you've figured out what Xt is doing you might go on to see the more advanced concepts in how Gtk+ does it. And once you've done this, you'll have a good idea of what Objective-C and C++ (minus templates) are doing under the covers. (Mostly C++, since ObjC is more or less Smalltalk's OO on top of X, whereas the core concepts of C++ are not so very different from what Xt does.) If you really want to dig in further, you might want to try to find the source to cfront, the original C++ implementation which was a preprocessor for the C compiler. It'll be missing a lot of modern C++ features, but the core is there. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Fwd: Object Oriented programming for Functional Programmers
sorry, forgot to reply-all -- Forwarded message -- From: Eli Frey eli.lee.f...@gmail.com Date: Sun, Dec 30, 2012 at 1:56 PM Subject: Re: [Haskell-cafe] Object Oriented programming for Functional Programmers To: Brandon Allbery allber...@gmail.com Except not quite... [...] It's not a built in table, it's a hidden parameter. I'll admit this doesn't HAVE to be the implementation. Often time the compiler can monomorphise the types and perform the lookup at compile time. But what's going on here tho. {-# LANGUAGE ExistentialQuantification #-} data Showable = forall a. Show a = Showable a printShowable :: Showable - IO () printShowable (Showable x) = print x main = mapM printShowable [ Showable bob, Showable 3, Showable Nothing ] If we take `mapM printShowable` and just give it an arbitrary list, it has to lookup the correct implementations of `print` as it walks down that list at run-time. I believe similar things motivate vtables in c++/java. I don't have a strong intuition about how dynamically typed OO langs deal with this, but I'm sure structural typing has similar issues. On Sun, Dec 30, 2012 at 1:27 PM, Brandon Allbery allber...@gmail.comwrote: On Sun, Dec 30, 2012 at 3:45 PM, Eli Frey eli.lee.f...@gmail.com wrote: mconcat :: Monad m = [m] - m mconcat = foldl mappend [] We can think of `mconcat` having a little lookup table inside of itself, and whenever we pass it a concrete `[m]`, `mappend` gets looked up and we get the implementation for `m`. Typeclasses are just mappings from types to functions Except not quite... the Monad m = in the signature really means hey, compiler, pass me the appropriate implementation of Monad so I can figure out what I'm doing with this type m. It's not a built in table, it's a hidden parameter. Aside from Object Orientation, it is probably a good idea to learn some C for a bit too. C is a good language to play in and try and implement more advanced language features. Once you reallize that objects are just lookup tables of functions bound with a data-structure, you can implement your own in C, or you can make closures as functions bundled with (some) of their arguments, or you can implement interesting datastructures, or so many other fun things. A good understanding of tagged unions has helped me in many a convo with an OO head. A perhaps strange suggestion in this vein: dig up the source code for Xt, the old X11 Toolkit, and the Xaw widget library that is built atop it. (It's part of the X11 source tree, since most of the basic X11 utilities and xterm are based on it.) It implements a primitive object system in C. Gtk+ does the same, but hides much of the implementation behind macros and relies on tricky casting etc. behind the scenes for performance; in Xt, the basic machinery is more easily visible for inspection and much easier to understand even if you're not all that familiar with C. If you go this way, once you've figured out what Xt is doing you might go on to see the more advanced concepts in how Gtk+ does it. And once you've done this, you'll have a good idea of what Objective-C and C++ (minus templates) are doing under the covers. (Mostly C++, since ObjC is more or less Smalltalk's OO on top of X, whereas the core concepts of C++ are not so very different from what Xt does.) If you really want to dig in further, you might want to try to find the source to cfront, the original C++ implementation which was a preprocessor for the C compiler. It'll be missing a lot of modern C++ features, but the core is there. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANNOUNCE: bindings to workqueue for distributed applications
Hello all I'm announcing a release of bindings to the WorkQueue distributed computing framework. This release comprises two packages: - bindings-cctools: low-level FFI bindings http://hackage.haskell.org/package/bindings-cctools - cctools-workqueue: high-level interface built on top of bindings-cctools http://hackage.haskell.org/package/cctools-workqueue WorkQueue is a Master/Worker framework for building flexible, fault-tolerant, distributed applications. WorkQueue has been used to scale to several thousand nodes, combining resources from different execution environments (HPC, cycle-scavenging, Cloud). Details can be found on the project website: http://www.nd.edu/~ccl/software/workqueue The current bindings are for version 3.6.1 of CCTools. Here are documentation for bindings-cctools and cctools-workqueue: http://nd.edu/~cabdulwa/haskell/doc/bindings-cctools-3.6.1.0.1.0.0/html http://nd.edu/~cabdulwa/haskell/doc/cctools-workqueue-3.6.1.0.1.0.0/html A documented example can be found in the repository. http://bitbucket.org/badi/hs-cctools-workqueue/src/v3.6.1.0.1.0.0/Example.hs If you want to try out these bindings, you will need to install CCTools first. http://www.nd.edu/~ccl/software/download.shtml Any feedback is welcome. Thanks. -- Badi' Abdul-Wahid ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: Object Oriented programming for Functional Programmers
On 12/30/2012 10:57 PM, Eli Frey wrote: sorry, forgot to reply-all -- Forwarded message -- From: *Eli Frey* eli.lee.f...@gmail.com mailto:eli.lee.f...@gmail.com Date: Sun, Dec 30, 2012 at 1:56 PM Subject: Re: [Haskell-cafe] Object Oriented programming for Functional Programmers To: Brandon Allbery allber...@gmail.com mailto:allber...@gmail.com Except not quite... [...] It's not a built in table, it's a hidden parameter. I'll admit this doesn't HAVE to be the implementation. Often time the compiler can monomorphise the types and perform the lookup at compile time. But what's going on here tho. {-# LANGUAGE ExistentialQuantification #-} data Showable = forall a. Show a = Showable a printShowable :: Showable - IO () printShowable (Showable x) = print x main = mapM printShowable [ Showable bob, Showable 3, Showable Nothing ] If we take `mapM printShowable` and just give it an arbitrary list, it has to lookup the correct implementations of `print` as it walks down that list at run-time. I believe similar things motivate vtables in c++/java. I don't have a strong intuition about how dynamically typed OO langs deal with this, but I'm sure structural typing has similar issues. ... The Showable constructor has two parameters. The 'Show' instance for 'a' (passed implicitly) and an 'a' (passed explicitly). When pattern matching, that instance gets unwrapped together with the payload. It is then implicitly passed to 'print', which finally uses it to look up the correct implementation of 'show'. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))
[featureX] is usually too powerful, it surely would be abused extensively, which would make developer's life a nightmare, unless there is only one developer and whole development takes no more than a couple of months. This doesn't say much about *why* syntax extension is too powerful, nor *how *that would lead to extensive abuse. Well, too powerful or not, meta-programming should be more easily available at least at *some *layer of language development without having to resort to hacking the compiler. -- Dan Burton ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
On Mon, Dec 31, 2012 at 1:28 AM, Daniel Díaz Casanueva dhelta.d...@gmail.com wrote: Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? Ive been collecting material regarding (confusions around) OO. Its far from complete but the references may be useful, eg - the Rees list on the different things that OO means to different people - the fundamental philosophical differences between commitment to declarativeness and imperativeness -- in philosophical language rationalism and empiricism As I said, its still in the early stage of bits and pieces being collected... http://blog.languager.org/2012/07/we-dont-need-no-o-orientation-2.html * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. In the C++ world Stepanov is almost on par with Stroupstrup. His STL has transformed C++ practices more than anything else Good to read his views on OOP http://en.wikipedia.org/wiki/Alexander_Stepanov#Criticism_of_OOP -- http://www.the-magus.in http://blog.languager.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
On Mon, Dec 31, 2012 at 7:30 AM, Rustom Mody rustompm...@gmail.com wrote: Ive been collecting material regarding (confusions around) OO. Its far from complete but the references may be useful, eg - the Rees list on the different things that OO means to different people - the fundamental philosophical differences between commitment to declarativeness and imperativeness -- in philosophical language rationalism and empiricism As I said, its still in the early stage of bits and pieces being collected... http://blog.languager.org/2012/07/we-dont-need-no-o-orientation-2.html * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. In the C++ world Stepanov is almost on par with Stroupstrup. His STL has transformed C++ practices more than anything else Good to read his views on OOP http://en.wikipedia.org/wiki/Alexander_Stepanov#Criticism_of_OOP Just realized that the resultant anti-OOP direction of my earlier mail is stronger than is good for a young computer scientist. In a field like ours its as important to be able to wear a technical/mathematical hat as a social or political one. And when the latter, its good to be able to participate in a discussion in which inheritance, UML etc etc figures. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
On Mon, 31 Dec 2012, MigMit miguelim...@yandex.ru wrote: Well, functional programmer is a relatively broad term. If you're coming from academia, so that for you Haskell is some sort of lambda-calculus, spoiled by practical aspects, then I'd suggest Luca Cardelli's book Theory of Objects. Also, as Daniel told you already, don't start from C++, it Name typo, should be Jay, noted. really has very little to do with OOP. It's primary merit is a very powerful system of macros (called templates in C++ world), not objects. If you want something mainstream, Java would be a good choice, and C# even better one (although it would be more convenient for you if you use Windows). Or you can try OCaml, which is functional enough for you not to feel lost, and object-oriented as well. ?? iPad For systems to look at I recommend Simula, some early version, Smalltalk, Common Lisp, and Erlang. My guess is that Haskell's type classes are a mechanism for creating something like Common Lisp's generic functions. I know too little about Haskell to say whether type classes immediately give you single dispatch things, or multiple dispatch things. These two Wikipedia articles are useful, I think: http://en.wikipedia.org/wiki/Generic_function [page was last modified on 15 November 2012 at 03:50] http://en.wikipedia.org/wiki/Common_Lisp_Object_System [page was last modified on 15 December 2012 at 23:57] The Diamond Problem and its cousin(s) are worth looking at: http://en.wikipedia.org/wiki/Diamond_problem#The_diamond_problem [page was last modified on 27 December 2012 at 04:53] http://www.ibm.com/developerworks/java/library/j-clojure-protocols/ http://stackoverflow.com/questions/4509782/simple-explanation-of-clojure-protocols oo--JS. 30.12.2012, ?? 23:58, Daniel D??az Casanueva dhelta.d...@gmail.com ??(??): Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. * Is it true that learning other programming languages leads to a better use of your favorite programming language? * Will I learn new programming strategies that I can use back in the Haskell world? Thanks in advance for your kind responses, Daniel D??az. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Added CLOS reference, was: Re: Object Oriented programming for Functional Programmers
This page looks to be a good introduction to CLOS: http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html oo--JS. On Sun, 30 Dec 2012, Jay Sulzberger wrote: On Mon, 31 Dec 2012, MigMit miguelim...@yandex.ru wrote: Well, functional programmer is a relatively broad term. If you're coming from academia, so that for you Haskell is some sort of lambda-calculus, spoiled by practical aspects, then I'd suggest Luca Cardelli's book Theory of Objects. Also, as Daniel told you already, don't start from C++, it Name typo, should be Jay, noted. really has very little to do with OOP. It's primary merit is a very powerful system of macros (called templates in C++ world), not objects. If you want something mainstream, Java would be a good choice, and C# even better one (although it would be more convenient for you if you use Windows). Or you can try OCaml, which is functional enough for you not to feel lost, and object-oriented as well. ?? iPad For systems to look at I recommend Simula, some early version, Smalltalk, Common Lisp, and Erlang. My guess is that Haskell's type classes are a mechanism for creating something like Common Lisp's generic functions. I know too little about Haskell to say whether type classes immediately give you single dispatch things, or multiple dispatch things. These two Wikipedia articles are useful, I think: http://en.wikipedia.org/wiki/Generic_function [page was last modified on 15 November 2012 at 03:50] http://en.wikipedia.org/wiki/Common_Lisp_Object_System [page was last modified on 15 December 2012 at 23:57] The Diamond Problem and its cousin(s) are worth looking at: http://en.wikipedia.org/wiki/Diamond_problem#The_diamond_problem [page was last modified on 27 December 2012 at 04:53] http://www.ibm.com/developerworks/java/library/j-clojure-protocols/ http://stackoverflow.com/questions/4509782/simple-explanation-of-clojure-protocols oo--JS. 30.12.2012, ?? 23:58, Daniel D??az Casanueva dhelta.d...@gmail.com ??(??): Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. * Is it true that learning other programming languages leads to a better use of your favorite programming language? * Will I learn new programming strategies that I can use back in the Haskell world? Thanks in advance for your kind responses, Daniel D??az. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))
On Sun, Dec 30, 2012 at 8:42 PM, Dan Burton danburton.em...@gmail.comwrote: [featureX] is usually too powerful, it surely would be abused extensively, which would make developer's life a nightmare, unless there is only one developer and whole development takes no more than a couple of months. This doesn't say much about *why* syntax extension is too powerful, nor *how *that would lead to extensive abuse. Well, too powerful or not, meta-programming should be more easily available at least at *some *layer of language development without having to resort to hacking the compiler. I think someone's already working on this (SugarHaskell?). -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
Since no one's mentioned it yet, you might consider learning Scala. A good starting point is http://www.artima.com/pins1ed/index.html (note that the free edition is outdated but still a good introduction). Scala has a mix of functional and OO programming styles, though (having come first from Haskell) I'd say it favors the OO side. If you approach it as OO with some nice functional touches (higher level list operations, immutability, recursively defined data structures, and pattern matching), it can be very fun to work with. Scala's type system is also more expressive than the other OO languages I've worked with, which is a big plus if you're coming from Haskell. Learning about subtyping and variance annotations via Scala gives you tools for reasoning about objects that you won't get from dynamically typed OO languages. On Sun, Dec 30, 2012 at 6:12 PM, Jay Sulzberger j...@panix.com wrote: On Mon, 31 Dec 2012, MigMit miguelim...@yandex.ru wrote: Well, functional programmer is a relatively broad term. If you're coming from academia, so that for you Haskell is some sort of lambda-calculus, spoiled by practical aspects, then I'd suggest Luca Cardelli's book Theory of Objects. Also, as Daniel told you already, don't start from C++, it Name typo, should be Jay, noted. really has very little to do with OOP. It's primary merit is a very powerful system of macros (called templates in C++ world), not objects. If you want something mainstream, Java would be a good choice, and C# even better one (although it would be more convenient for you if you use Windows). Or you can try OCaml, which is functional enough for you not to feel lost, and object-oriented as well. Отправлено с iPad For systems to look at I recommend Simula, some early version, Smalltalk, Common Lisp, and Erlang. My guess is that Haskell's type classes are a mechanism for creating something like Common Lisp's generic functions. I know too little about Haskell to say whether type classes immediately give you single dispatch things, or multiple dispatch things. These two Wikipedia articles are useful, I think: http://en.wikipedia.org/wiki/**Generic_functionhttp://en.wikipedia.org/wiki/Generic_function [page was last modified on 15 November 2012 at 03:50] http://en.wikipedia.org/wiki/**Common_Lisp_Object_Systemhttp://en.wikipedia.org/wiki/Common_Lisp_Object_System [page was last modified on 15 December 2012 at 23:57] The Diamond Problem and its cousin(s) are worth looking at: http://en.wikipedia.org/wiki/**Diamond_problem#The_diamond_**problemhttp://en.wikipedia.org/wiki/Diamond_problem#The_diamond_problem [page was last modified on 27 December 2012 at 04:53] http://www.ibm.com/**developerworks/java/library/j-**clojure-protocols/http://www.ibm.com/developerworks/java/library/j-clojure-protocols/ http://stackoverflow.com/**questions/4509782/simple-** explanation-of-clojure-**protocolshttp://stackoverflow.com/questions/4509782/simple-explanation-of-clojure-protocols oo--JS. 30.12.2012, в 23:58, Daniel Díaz Casanueva dhelta.d...@gmail.com написал(а): Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. * Is it true that learning other programming languages leads to a better use of your favorite programming
Re: [Haskell-cafe] Object Oriented programming for Functional Programmers
There's OOHaskell, which you can google for. The name's such a nice example of an aptronym: it's the Overlooked Object-oriented Haskell. -- Kim-Ee On Mon, Dec 31, 2012 at 2:58 AM, Daniel Díaz Casanueva dhelta.d...@gmail.com wrote: Hello, Haskell Cafe folks. My programming life (which has started about 3-4 years ago) has always been in the functional paradigm. Eventually, I had to program in Pascal and Prolog for my University (where I learned Haskell). I also did some PHP, SQL and HTML while building some web sites, languages that I taught to myself. I have never had any contact with JavaScript though. But all these languages were in my life as secondary languages, being Haskell my predominant preference. Haskell was the first programming language I learned, and subsequent languages never seemed so natural and worthwhile to me. In fact, every time I had to use another language, I created a combinator library in Haskell to write it (this was the reason that brought me to start with the HaTeX library). Of course, this practice wasn't always the best approach. But, why I am writing this to you, haskellers? Well, my curiosity is bringing me to learn a new general purpose programming language. Haskellers are frequently comparing Object-Oriented languages with Haskell itself, but I have never programmed in any OO-language! (perhaps this is an uncommon case) I thought it could be good to me (as a programmer) to learn C/C++. Many interesting courses (most of them) use these languages and I feel like limited for being a Haskell programmer. It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life. So my questions for you all are: * Is it really worthwhile for me to learn OO-programming? * If so, where should I start? There are plenty of functional programming for OO programmers but I have never seen OO programming for functional programmers. * Is it true that learning other programming languages leads to a better use of your favorite programming language? * Will I learn new programming strategies that I can use back in the Haskell world? Thanks in advance for your kind responses, Daniel Díaz. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe