[Haskell-cafe] Gtk2Hs drag and drop
Hi, have somebody used drag and drop feature of Gtk2hs? I can't find any tutorial or demo. I'm using only the documentation but I think I'm missing something. Can anyone give me an example? Thanks in forward! Fero ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Incremental trasnformations (not Haskell topic)
Still nobody? Maybe I didn't write it clear. So one more time: I have a list of numbers (say Int) numberList = [1:Int,2,3,1,2,6,7,8] and a number sumOfNumberList = sum numberList and here comes the question. Imagine the list numberLists is mutable (that's why in topic is not Haskell question) so the calculation doesn't occur only once but every time something changed in the list (listener pattern). (If the lis tis java List and Int is java Integer, every acces to list should trigger event to its listeners, but if I use list of another objects e.g. Item with value, every access to list should trigger event to its listeners as well as every modification of object Item should triggers its listeners (list) and that in turn triggers its listeners) How to make transformation of often used functions (map, sum, forall, filter, exists) to listeners in OO language? Is there anything (any tool, any paper, any blog...) about it? Thanks Fero PS If nobody answers I really stop asking non Haskell questions in this mailling list:) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Incremental trasnformations (not Haskell topic)
Thanks Ingram. It seems to be exactly what I was searching for:-) I knew I can rely on Haskellers.. This is from abstract ( http://ttic.uchicago.edu/~umut/papers/toplas06.pdf): We present techniques for incremental computing by introducing adaptive functional programming. As an adaptive program executes, the underlying system represents the data and control dependences in the execution in the form of a dynamic dependence graph. When the input to the program changes, a change propagation algorithm updates the output and the dynamic dependence graph by propagating changes through the graph and re-executing code where necessary. Adaptive programs adapt their output to any change in the input, small or large. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Defining a containing function on polymorphic list
Hi Raeck, as I see what types you defined, don't you doing School of Expression? (In summer I made my way to FAL chapter, but I had no time more (school), but I will definitely finish that book:) Fero ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Incremental trasnformations (not Haskell topic)
Hi, this is not a Haskell question but I'm not sure if anyone in java community can answer this. And I'm sure every Haskell programmer know OO programing. I'm programming one big boring db application and making a MDD tool to model and generate such applications. Many times object have computed attributes: E.g. value attribute of class Invoice is sum of values of all associated classes Item (Invoice 1 --- * Item) So value attribute of invoice is computed every time it is demanded. So far easy.Sometimes it is necessary not to compute it when it is needed but to have it precomputed (computed it every time, item is added/removed to invoice or item value is changed). Contract of attribute value is the same but it is not obvious from code if you program it in event-based as if you program it with expression which is computed every time. Event-based=no big picture. Expression=big picture but little performance. Question: Is there any way how to transform the OO transformation (invoice value is a sum of values of items) to incremental transformation (update invoice value, when item is created/deleted/changed)? Is there any product doing it. I am not interesting in product itself I want only see how it works? Is there any science paper on this? I call this not a function but a OO transformation because it can be much more complicated. I know it is not possible for all the functions (transformations), you have to do undo step, but it is possible for that what we use. One more complicated example: Provider provides money to receiver. It provides money with special code. Receiver sees all the money from all the providers grouped by the code and summed. Every summed group on the code has a subgroup summed on the provider. Provider A provides to R 10 on code ABC Provider A provides to Q 10 on code ABC Provider A provides to R 5 on code ABC Provider A provides to R 20 on code DEF Provider B provides to R 30 on code ABC Reciever R - recieves 45 on code ABC, 15 from A, 30 from B - recieves 20 on code DEF, 20 from A Reciever Q - recieves 10 on code ABC, 10 from A This example can be easily programmed declarative way in Scala the way that everytime everything is computed. But have no clue if it can be transformed automatically to incremental way. Hope you understand what I mean. Thanks for your help and opinions Fero ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Problems with strictness analysis?
yet I need to add a $! to the recursive call of isum to get a truly iterative ??? Wait a minute Patai. How would you do that? I'm only beginner I thought I can only add strict ! to data parameters. But to make isum function strict would be helpful. Thanks On Mon, Nov 3, 2008 at 7:36 PM, Don Stewart [EMAIL PROTECTED] wrote: patai_gergely: Hi everyone, I was experimenting with simple accumulator functions, and found that an apparently tail recursive function can easily fill the stack. Playing around with ghc and jhc gave consistently unpleasant results. Look at this program: %%% -- ghc: no, ghc -O3: yes, jhc: no isum 0 s = s isum n s = isum (n-1) (s+n) -- ghc: no, ghc -O3: no, jhc: yes (because gcc -O3 is clever) rsum 0 = 0 rsum n = n + rsum (n-1) main = case isum 1000 0 {- rsum 1000 -} of 0 - print 0 x - print x %%% I would expect the analysis to find out that the result of the function is needed in every case (since we are matching a pattern to it), yet I need to add a $! to the recursive call of isum to get a truly iterative function. It's interesting how ghc and jhc seem to diverge, one favouring the iterative version, the other the recursive one (although it only works because gcc figures out that the function can be expressed in an iterative way). Of course this is a real problem when I'm trying to write an actual program, since it means I can be bitten by the laziness bug any time... Is there any solution besides adding strictness annotations? Can I expect the compiler to handle this situation better in the foreseeable future? I think its sensible not to rely on an analysis to infer the correct reduction strategy for your code. Make the strictness explict, and your code will be more portable and more robust. Also, write in some type annotations. Particularly for atomic types like Int, these give the strictness analyser yet more information to work with. -- Don ___ 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] Haskell on the JVM
Sorry, as Chris Eidhof replied to me CAL is not pure. I was only playing with GemCutter, I don't use CAL so I didn't know. Fero On Sun, Oct 12, 2008 at 5:32 PM, frantisek kocun [EMAIL PROTECTED]wrote: There is CAL language (purely functional, very Haskell like, the most I have seen). CAL Eclipse plugin (IDE for CAL for non java-ers) is incredible, with support for code comletition, documentation, refactor, code navigation.. They have graphical editor GemCutter for it as well. You can use java libraries within it with unsafe imports or call cal function from java or there is even embedded CAL in Java:) Check out: http://openquark.org Embeded CAL: http://groups.google.com/group/cal_language/web/embedded-cal This is from CAL for Haskell Programmers: CAL implements essentially all the non-syntactic sugar features of Haskell 98 (with its standard addendums) including: • algebraic functions with parametric polymorphism and inferred types o type declarations can specialize or assert types • data declarations for algebraic types o strictness flags for data constructor arguments • a module system supporting separate compilation • expression syntax supporting if-then-else, case, let (for both local variable and function definitions) and lambda expressions o support for most of Haskell's expression operators • special syntax for tuples, strings, characters, numbers and lists • an extensive collection of standard libraries • single parameter type classes o superclasses o derived instances, such as the instance declaration for Eq List o deriving clauses for common classes o default class method definitions o higher-kinded type variables, such as with the Functor type class • dynamics support via the Typeable type class and Dynamic type • user documentation generated from source code (similar to Haddock) • foreign function support • hierarchical module names Another interesting project is COHATOE (contributing Haskell to Eclipse) by which one can write Haskell plugins to Eclipse, but I have no clue how it works. http://eclipsefp.sourceforge.net/cohatoe/ Fero ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell on the JVM
There is CAL language (purely functional, very Haskell like, the most I have seen). CAL Eclipse plugin (IDE for CAL for non java-ers) is incredible, with support for code comletition, documentation, refactor, code navigation.. They have graphical editor GemCutter for it as well. You can use java libraries within it with unsafe imports or call cal function from java or there is even embedded CAL in Java:) Check out: http://openquark.org Embeded CAL: http://groups.google.com/group/cal_language/web/embedded-cal This is from CAL for Haskell Programmers: CAL implements essentially all the non-syntactic sugar features of Haskell 98 (with its standard addendums) including: • algebraic functions with parametric polymorphism and inferred types o type declarations can specialize or assert types • data declarations for algebraic types o strictness flags for data constructor arguments • a module system supporting separate compilation • expression syntax supporting if-then-else, case, let (for both local variable and function definitions) and lambda expressions o support for most of Haskell's expression operators • special syntax for tuples, strings, characters, numbers and lists • an extensive collection of standard libraries • single parameter type classes o superclasses o derived instances, such as the instance declaration for Eq List o deriving clauses for common classes o default class method definitions o higher-kinded type variables, such as with the Functor type class • dynamics support via the Typeable type class and Dynamic type • user documentation generated from source code (similar to Haddock) • foreign function support • hierarchical module names Another interesting project is COHATOE (contributing Haskell to Eclipse) by which one can write Haskell plugins to Eclipse, but I have no clue how it works. http://eclipsefp.sourceforge.net/cohatoe/ Fero ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Best book/tutorial on category theory and its applications
Thanks Benjamin, especially for http://haskell.org/haskellwiki/Category_theory#See_also and I found there Haskell wiki. I will take a look at the books as well. Fero On Mon, Jul 28, 2008 at 2:14 PM, Benjamin L. Russell [EMAIL PROTECTED] wrote: On Mon, 28 Jul 2008 20:04:17 +0900, Benjamin L.Russell [EMAIL PROTECTED] wrote: What do you think about Categories and Computer Science (Cambridge Computer Science Texts) at http://www.amazon.com/Categories-Computer-Science-Cambridge-Texts/dp/0521422264/ref=si3_rdr_bb_product ? I haven't read it, so I would need to review it before giving an opinion. I shall keep it in mind, however; thank you for the reference. I have just added information on _Categories and Computer Science (Cambridge Computer Science Texts)_ to the HaskellWiki; viz.: Books and tutorials - HaskellWiki http://www.haskell.org/haskellwiki/Books_and_tutorials Incidentally, my earlier references to books on category theory all originally were obtained from the HaskellWiki page on Category Theory: Category theory - HaskellWiki http://haskell.org/haskellwiki/Category_theory#See_also You may find some other useful references there as well. -- Benjamin L. Russell ___ 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] Linux kernel/library question
Hi Vasili, try one of Linux groups at http://www.nabble.com/Linux-f252.html or maybe Linux kernel group http://www.nabble.com/linux-kernel-f49.html . But I don't know if there are people working with Haskell in Linux as well. But if you would like to ask something only about POSIX, I think they may help. Fero 2008/7/21 Galchin, Vasili [EMAIL PROTECTED]: Hello, I am working on POSIX stuff. I have used Linux as my POSIX OS and have read source when I could find it. Does anybody in this group of Linux newsgroup where one can ask Linux-related implementation questions? Regards, Vasili ___ 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] Searchig for modules
It works when I put -idirs c:\eworkspace2\Soe\src\SOE to extra compiler options and set GHCi to use GHC setting, but you need to restart ecpilse. And the module, wht is loaded is SOE so I always need to switch module.. Fero On Thu, Jul 17, 2008 at 1:18 PM, fero [EMAIL PROTECTED] wrote: Actually I have already found the way how to do it but not in eclipsefp. Either I run ghci and when both modules are in the same dir it works or I use -idirs but in eclipsefp it doesn't. Can somebody help me how to configure eclipsefp. I don't want to go to command prompt every time I want to run my program. Fero -- View this message in context: http://www.nabble.com/Searchig-for-modules-tp18505770p18506257.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ 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