Re: [Haskell-cafe] Mapping Haskell Concepts To C# 3
Hi (I did not received your message in my mail box and I have seen it on mailing list. I dot know why this happened (?).) /* Maybe I am misguessing why you are asking your question, but wouldn't it be better to ask how to map these Haskell concepts to CLR? If so, check out work on Mondrian. */ My intention is to employ Haskell techniques in C# where it fits. If I were going to implement Haskell on CLR the way you mentioned was proper. For something like: type Thing a b = ThisWay a | ThatWay b | NoWay actually there is no equivalents for data constructor in C# 3 (I think). I asked it if there are other ideas about this: Controlling the execution path by deciding based of structure of data with a trick other than reflecting! Thank you ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Mapping Haskell Concepts To C# 3
I have question on mapping some Haskell concepts to C# 3 ones. Maybe there are not any strict equivalents; yet it helps: 1 - What is the equivalent of "Type Constructor" in C#? 2 - What is the equivalent of "Data Constructor" in C#? 3 - What is the logical implementation of pattern matching in C#? (For example using structures with indicator fields or using interfaces and inheritance and dynamically dispatch in calling overloaded methods. Also this question contain a hidden one...GADTs!) Best Regards -- Kaveh Shahbazian email: [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Monad Description For Imperative Programmer
This is about to put a definition/description to test. So please cooperate! ;) Is this a useful – sufficient, not complete – definition/description for a monad; for an imperative mind: (?) "A monad is like a loop that can run a new function against it's variable in each iteration." (I insist on the simplicity! And I will resist any expansion of this sentence (except for an exceptional note that I think of it hardly). I think there is not any complete definitions in computer world. At least there are many things to know when you want to use them in practice. So please have this in mind and review me!) Cheers :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Aim Of Haskell
Yes! You are right commercials benefits from academics; NO DOUBT! No one will discuss anything against that because that's obvious where is the source. But It is not obvious where is the destination. Maybe new-comers need to be more Haskellized first. But that's not the problem. In this thread many good libraries has been named for : XML, GUI, OpenGL, WEB, etc. Yet this can not be named "mature". As a "research foundation" point of view Haskell is perfect. Again no doubt about It. But this feature-full dude (Haskell) makes it's way in different directions without harmony. For example some of the projects are dead for about 3-4 years (especially c-interfaces). So this libraries are living and growing in separate islands lonely! And this can not be a plateform for development. And about being over-demanding : Maybe this is true. But why Haskell is over-demanding? Because It is attracting! That's a point of power and a big plus (If it gets to be seen!). Best Regards ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Aim Of Haskell
I think this is going out of the way. Excuse me, but the main discussion was not about pascal! And thanks again to all. Now I think there is a bigger whole between current situation of Haskell and using It as a real tool, than what I thought before. But any way; I still have a hope for rising a new folk of thinkers in software world that will put ideas to work more practically. Haskell got academic-centric-being syndrome, as JAVA got perfectionism syndrome (see elegant and useless design patterns and architectures there!). I can not imagine a pure and clear vision about this new folk that IT world lakes now. If anyone helps me with clarification of this thing, It will be great to me! Best regards ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Aim Of Haskell
Thanks again. Look all. When I (and I think everybody here) make a discussion about Haskell, It is not about to dominating anyone('s opinions) or attacking to Haskell (for Haskell evangelists!); Haskell is great enough that surely will lead - if not "be" - the next picture for meaning of "SOFTWARE DEVELOPING". I did not know anything about functional programming. I have a B.S. in telecommunications and ... as you know one day I woke up in bed lying beside my beloved codes! And there I became a programmer! Then I came across with scripting : Ruby! Lovely! Fantastic! At first It was very hard for my "c-writer" mind to even understand what this "scripting thing" is. But at last I felt It and learned how to do It. And with more reading, suddenly there was something totally different : Functional Programming. See : Reduced of many many type of bugs in your code; why? No side effect! Debugging! Profiling! Type safety! So why I say that? Again see : In less than five years we will have processors with normally six cores or more and fast hardware - very cheap. Hold that. So you still want to pay your developers for checking "NULL" values, correctness of "INTERFACES", writing "IF ELSE" and "SELECT CASE"s full of side effect and junks (Something that can be simply implemented by "Pattern Matching"), continuing OO world that has not even a accurate calculus for describing things (and came from industrial engineering), code that may crash through exceptions and very stupid-complex execution paths, checking array out-of rang things, handling and passing and dereferencing pointers correctly...H! Just calculate that how % of developer's time is being consumed by this stupid tasks? You know; this will be a big-bang for commercials! (If their stupid consultants can understand). I am a usual developer, not smart and academic as you, and not as stupid ones to pretend to know something better than all. Even this kind of programming still is very hard for me. I am still struggling with monads and monad transformers! So I am choosing the hard path - even very hard one. Why? Because I am sure every mean developer like me can be productive in functional programming in 6 to 12 months. And imagine that huge bunch of stupid things that we are handling everyday : Just wast of life and money without any joy and honor. This is my vision : FIVE YEARS ... Best Regards ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[2]: [Haskell-cafe] Aim Of Haskell
Thanks for responsing. I am not the only one that has such a question. Please take a look at http://www.defmacro.org/ramblings/not-ready.html. On 12/11/06, Neil Mitchell <[EMAIL PROTECTED]> wrote: Hi > sorry, but imho H98 can't be used for real program development. btw, are > you know large programs that can be compiled with H98 compilers, such as > nhc, yhc and jhc? Yhc itself. Hoogle. Catch (~25000 lines). Haskell 98 is a great language, sure there are bits that could be tweaked to make it easier to program in, but its got all the good stuff in it. Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Best Introduction To Monads For Newbies (& Especially Imparative Minds) I'v Ever Read!!!
This is the best introduction to "Monads" for newbies and imparative mined that I'v ever read! For a long time I was searching for such an excellent text on monads. Ofcourse there are many good text there. But all of them are about mathematics and how clever the monads are. After all most of them are useless for a practical approach. Take a look at this http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads-and.html !! Have a good time with it!! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Microsoftish Haskell
Thanks Don I sense the truth in your words. But I expect a more technical view of point. I need it for presenting to other peoples i.e. to whom wanted fom me an overview of Haskell/Using It/Licensing/Libraries/Communities to be provided (BOSS!). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Microsoftish Haskell
1 - Prologue I am writing C# WEB/Desktop/Embeded applications for 3 years by now and before that, I was writing Visual C++/MFC/COM sort of things. I can say now that everything that come from microsoft is a handcraft of a saleman that has no guaranty and will break before you get home and even try it! For example see generics in C#. These thing are just a code generatore utility that is embeded in Visual Studio 2005 and Microsoft "JUST" has named it "GENERICS". For comparation see generics in Java 5.0. 2 - Question Will Haskell become another pet for Microsoft? If Yes/No, Why? (There are many issues around licensing GHC as you'v seen in this mailing list and I think Haskell already HAS some big problems that prevent others to use it confidently.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[2]: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?
I think we need a subset of haskell as a new language (or as a developing pattern) to work with and teach and learn more easily as you have mentioned. I had read a text about mathematics which was something like this : "New mathematic theories does not populize because of their fabiolus logical theorems, but because of death of elder mathematicians and forging a new folk of them that were rised by new theories.". That is usefull to have in mind. (And because of that, maybe there is no force to compele someone to disturbe his mind on a peacfull friday afternoon! ;) ) Anyway the point is developing more efficient and easily; instead of serving marketing features of languages. And there must be - and will be - someone (or some will) to makes things better. "very high level of FP" in Haskell is good but there is no lower level of them somewhere else. So almost the only choice for a usefull FP environment is Haskell. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?
Then I must apologize again. (Communications and activities are so attractive that I cann't prevent my self from it. One aspect of it is to apologize. :D). Thankyou and Thank you too! ;) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?
I made a mistake : popularity! This was a meaning that described my thoughts at that moment. Let me make it clear by another question : Can someone say perl is popular? If we see it that way, I meant a good and efficient community-based expansion and some good tools to use. how can we decrease Haskell popularity? Why? Because someone must prevent mean programmers to try Haskell? Or it is a bit of old holy codex? Or maybe I must feal tired of hearing newbies questions? If Haskell replaces C++ is some places - which had been proved is many areas - how amount of bugs will disapear just because of a well designed language? And If you are affraid of something that happens to java by j++ - a lot of buzzy extensions from big boys - why not to have an "ISO Haskell"? Thanks ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Monad Imparative Usage Example
Very Thankyou I am starting to feel it. I think about it as a 'context' that wraps some computations, which are handled by compiler environment (please make me correct if I am wrong). Now I think I need to find out how this 'monads' fit in solving problems. And for that I must go through bigger programs to write. Thanks again ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?
I do not meant to compile Haskell to MSIL/JVM. I meant to compile Haskell to the Java or C# itself! And GHC will be there for a high performance language (but still O'Caml is better by the time). But Java proves that in enterprise solution, performance is a complex factor of many thing other than speed alone. I love high performance implementation like Haskell. But there must be a way to populize Haskell! Thanks ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?
1 & 2 - Maybe this is not a proper question but I think It has a point. Why Not Compiling To Java Or C#? What is the need of implementing a class interoperability between Haskell and other plateforms? Maybe we donot need that. Haskell can be the big infrastructure and code snippets in Java or C# can serve in a monadic wrapper. It looks like that we can scripting Haskell in that languages. For example F# 's target code is ILX (an extension of MSIL for functional languages). But I think interoperablity between languages - like what .NET claims - is totaly pointless. Again think of an infrastructure that has a Haskell core which defines and controls very high level processes. Then there will be a running machine that Haskell is sitting on top of it. This running machine implement haskell in the plateform language. This is what I mean. 3 - And for an OOP style interoperability between languages, I think most usefull is to have a robust standard for Object-Broking. Something like IEC 61850 in new power systems in industry. A tool from siemens can understand what a hitachi high voltage key commands and all of these devices are from different providers with different internal implementations that meets the standard. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why Not Haskell?
I have started to love haskell and like these friends I am starting to be annoying about "Why not haskell?" and realy realy why not haskell? In commercial world there are buzz-oriented languages that do the "barking to the picture" in their "communities" - which are in fact groups of free marketers for "the companies". Let all those guys continue to bulk their noisy space! But again "why not haskell?". I think - this is my opinion according to my experiences and abilities and I know they are not the best ones; I only try to participate in this discussion which is important to me - the main reasons are two: 1 - monads : there must be something to make a clear tool for a none-mathematician programmer. (I still have understanding problems with them). 2 - there must be an easy way to include existing libraries. There are many stable libraries in CPAN for perl, implemented in C for example. And why not to have a system for writing C in haskell? Or an easy interface for using these codes without reimplementing haskell identities in C? Thanks all ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Monad Imparative Usage Example
Thanks All This is about my tries to understand monads and handling state - as you perfectly know - is one of them. I have understood a little about monads but that knowledge does not satidfy me. Again Thankyou On 8/2/06, Duncan Coutts <[EMAIL PROTECTED]> wrote: On Wed, 2006-08-02 at 13:26 +0330, Kaveh Shahbazian wrote: > Haskell is the most powerfull and interesting "thing" I'v ever > encountered in IT world. But with an imparative background and lack of > understanding (because of any thing include that maybe I am not that > smart) has brought me problems. I know this is an old issue. But > please help it. > Question : Could anyone show me a sample of using a monad as a > statefull variable? > For example see this code in C# : > // > public class Test > { > int var; > static void Fun1() { var = 0; Console.Write(var); } > static void Fun2() { var = var + 4; Console.Write(var); } > static void Main() { Fun1(); Fun2(); var = 10; Console.Write("var > = " + var.ToString()); } > } > // > I want to see this code in haskell. As other people have noted, you probably don't want to to see this code in Haskell. It's possible to translate stateful code in a 1-1 style but that's not really the point. You'll not get much of the advantages of the language if you do that. You can certainly use console IO etc but for your object containing mutable state, well in a functional style you'd simply not do that and solve the problem in a different way. That's why you see the code people have suggested as translations are bigger than the code you started with, because the language is not naturally imperative. So the trick is to solve your problem in Haskell, not translate your imperative solution to Haskell. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Monad Imparative Usage Example
Thanks All This is about my tries to understand monads and handling state - as you perfectly know - is one of them. I have understood a little about monads but that knowledge does not satidfy me. Again Thankyou On 8/2/06, Donn Cave <[EMAIL PROTECTED]> wrote: On Wed, 2 Aug 2006, Donald Bruce Stewart wrote: ... > Of course, if you're learning Haskell, you should probably try to > /avoid/ mutable variables for a while. Along the same line, I note that proposed solutions seem to use features relatively recently added to the language, is that true? StateT requires multi-parameter type class, for example, so it can't have been there all along. MVar is pretty new, isn't it? IORef must be the oldest of them, but hardly there from the start, I suspect. To learn core concepts, maybe it's a good idea to stay away from GHC in the beginning, and use Hugs or something that tends not to be so much of a magnet for new features. That forces you to look for a solution on the terms of the basic language concepts. Donn ___ 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] Monad Imparative Usage Example
Monad Imparative Usage Example Thanks for your replies. I have not haskell on this computer and I will try this solutions tonight. I must notice that IO computations is not the point here. My target is to have this code for mutable variable 'var'. # Haskell is the most powerfull and interesting "thing" I'v ever encountered in IT world. But with an imparative background and lack of understanding (because of any thing include that maybe I am not that smart) has brought me problems. I know this is an old issue. But please help it. Question : Could anyone show me a sample of using a monad as a statefull variable? For example see this code in C# : // public class Test { int var; static void Fun1() { var = 0; Console.Write(var); } static void Fun2() { var = var + 4; Console.Write(var); } static void Main() { Fun1(); Fun2(); var = 10; Console.Write("var = " + var.ToString()); } } // I want to see this code in haskell. Thankyou # ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Monad Imparative Usage Example
Haskell is the most powerfull and interesting "thing" I'v ever encountered in IT world. But with an imparative background and lack of understanding (because of any thing include that maybe I am not that smart) has brought me problems. I know this is an old issue. But please help it. Question : Could anyone show me a sample of using a monad as a statefull variable? For example see this code in C# : // public class Test { int var; static void Fun1() { var = 0; Console.Write(var); } static void Fun2() { var = var + 4; Console.Write(var); } static void Main() { Fun1(); Fun2(); var = 10; Console.Write("var = " + var.ToString()); } } // I want to see this code in haskell. Thankyou ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Fwd: [Haskell-cafe] Apache HTTP Server And Haskell
Thanks, But it seems to be dead! (Last news on 18 Apr 2002). Is there a more mature one? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Apache HTTP Server And Haskell
Is there a mod_haskell (like mod_perl and mod_python) for Apache HTTP server? Does anyone know about it? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe