[Haskell-cafe] Re: Error Calling Lua Function

2010-10-23 Thread Gracjan Polak
Change this: succ - Lua.loadfile l /Haskell2Lua.lua into succ - Lua.loadfile l Haskell2Lua.lua Note that 0 at the beginning says there was an error loading a script. I should make it an exception I guess... -- Gracjan ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Redy to release gtk2hs-0.12.0!

2010-10-23 Thread Felipe Lessa
Great! What's new in 0.12.0? I don't see a NEWS file and the ChangeLog is old. Cheers! =) -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Redy to release gtk2hs-0.12.0!

2010-10-23 Thread Andy Stewart
Felipe Lessa felipe.le...@gmail.com writes: Great! What's new in 0.12.0? I don't see a NEWS file and the ChangeLog is old. Use command darcs changes see detail. The NEWS in gtk2hs-0.12.0 : * Support all APIs from GTK+2.8 ~ GTK+2.22 Look http://www.gtk.org/language-bindings.html Of

[Haskell-cafe] [ANNOUNCE] text-xml-qq - XML quasiquoter for Text.XML.Light

2010-10-23 Thread Oscar Finnsson
Hi, I've just released the first version of text-xml-qq, It's a Template Haskell quasiquoter that converts XML code into Text.XML.Light.Element compile time. Feature requests, bug fixes etc are welcomed. The package only got one backend (xml-package) at the moment but it should be trivial to add

Re: [Haskell-cafe] Scrap your rolls/unrolls

2010-10-23 Thread Sebastian Fischer
Hi Max, neat idea! Haskell supports laziness even on the type level ;) I tried to play with your code but did not get very far. I quickly ran into two problems. On Oct 22, 2010, at 7:37 PM, Max Bolingbroke wrote: The annoying part of this exercise is the the presence of a Force in the

Re: [Haskell-cafe] Re: Error Calling Lua Function

2010-10-23 Thread aditya siram
I did that, the slash is a typo. I was looking at the Lua reference manual and it says that lua_loadfile uses lua_load[1] which outputs 0 if successful. Appreciate the quick response. -deech [1] http://www.lua.org/manual/5.1/manual.html#lua_load On Sat, Oct 23, 2010 at 2:49 AM, Gracjan Polak

[Haskell-cafe] Compiling and installing glib and gtk+ on Snow Leopard

2010-10-23 Thread Mark Spezzano
Hi, I'm trying to install the Leksah IDE and I've run into the problem that it requires glib and gtk+. Whenever I type 'configure' for glib-2.26.0 everything goes fine. But when I type 'make' it goes through necessary actions and then suddenly stops halfway through stating the following

Re: [Haskell-cafe] Scrap your rolls/unrolls

2010-10-23 Thread Sjoerd Visscher
On Oct 23, 2010, at 1:27 PM, Sebastian Fischer wrote: I think `Control.Functor.Categorical.CFunctor` is a more natural replacement for functor here. One can define instance CFunctor (ListF a) ForceCat Hask and I was hoping that I could define `fold` based on CFunctor but I did not

Re: [Haskell-cafe] Scrap your rolls/unrolls

2010-10-23 Thread Sjoerd Visscher
A little prettier (the cata detour wasn't needed after all): data IdThunk a type instance Force (IdThunk a) = a type Alg f a = f (IdThunk a) - a fold :: CFunctor f ForceCat (-) = Alg f a - Fix f - a fold alg = alg . cmap (ForceCat $ fold alg) sumAlg :: Alg (ListF Int) Int

Re: Re[2]: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread John Lato
On Fri, Oct 22, 2010 at 6:16 PM, Bulat Ziganshin bulat.zigans...@gmail.comwrote: Hello John, Monday, October 18, 2010, 8:15:42 PM, you wrote: If anyone is listening, I would very much like for there to be a mechanism by which external functions can be called unsafe-ly, but without

Re: [Haskell-cafe] Scrap your rolls/unrolls

2010-10-23 Thread Max Bolingbroke
On 23 October 2010 15:32, Sjoerd Visscher sjo...@w3future.com wrote: A little prettier (the cata detour wasn't needed after all):   data IdThunk a   type instance Force (IdThunk a) = a Yes, this IdThunk is key - in my own implementation I called this Forced, so: type instance Force (Forced

[Haskell-cafe] Haskell meeting in Berlin

2010-10-23 Thread Sönke Hahn
Hi all! There will be an informal Haskell meeting in Berlin. Date: Thursday, October 28th Time: from 20:00 Location: c-base, Rungestrasse 20, 10179 Berlin The bi-monthly lisp meeting takes place at the same time and place [1]. This is the first of hopefully more meetings to come, so we will

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread Gregory Crosswhite
On 10/23/10 7:54 AM, John Lato wrote: On Fri, Oct 22, 2010 at 6:16 PM, Bulat Ziganshin bulat.zigans...@gmail.com mailto:bulat.zigans...@gmail.com wrote: Hello John, Monday, October 18, 2010, 8:15:42 PM, you wrote: If anyone is listening, I would very much like for there to be a

Re: [Haskell-cafe] Scrap your rolls/unrolls

2010-10-23 Thread Sjoerd Visscher
I use Apply for Functor application in data-category, I used an infix operator :% http://hackage.haskell.org/packages/archive/data-category/0.3.0.1/doc/html/src/Data-Category-Functor.html#line-57 F.e. composition is defined like this: type instance (g :.: h) :% a = g :% (h :% a) Sjoerd On

[Haskell-cafe] Re: Haskell meeting in Berlin

2010-10-23 Thread Johannes Waldmann
There will be an informal Haskell meeting [...] The bi-monthly lisp meeting [...] [1] http://www.c-base.org/calender/phpicalendar/month.php Pray tell - which of the three above-mentioned languages is from the dark side? ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Haskellers design

2010-10-23 Thread Michael Snoyman
It looks good to me. Are there any objections to using this for Haskellers? On Sat, Oct 23, 2010 at 3:31 AM, Nubis nu...@woobiz.com.ar wrote: Hi guys, It's me again, I made a new proposal for the website with the standard colors. I've put my pretentions of content being grouped by color, and

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/22/10 19:16 , Bulat Ziganshin wrote: Monday, October 18, 2010, 8:15:42 PM, you wrote: If anyone is listening, I would very much like for there to be a mechanism by which external functions can be called unsafe-ly, but without blocking all

Re: [Haskell-cafe] Bug in HTTP (bad internal error handling)

2010-10-23 Thread Ganesh Sittampalam
Hi Bit, On Thu, 21 Oct 2010, Bit Connor wrote: On Sat, Oct 16, 2010 at 10:29 AM, Claus Reinke claus.rei...@talk21.com wrote: After it catches this error, the function returns (line 376): return (fail (show e)) The fail is running in the Either monad (The Result type = Either). This calls

Re: [Haskell-cafe] Error Calling Lua Function

2010-10-23 Thread Claude Heiland-Allen
Hi Aditya, The problem is not that the file was not loaded, but that in Lua, loading a file only loads it and does not execute it; Lua is a dynamic language, by which I mean that definitions are created through execution. Attached is a simple example, note that there is no proper error

Re: [Haskell-cafe] Compiling and installing glib and gtk+ on Snow Leopard

2010-10-23 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/23/10 10:00 , Mark Spezzano wrote: What, exactly is happening here? I've compiled libiconv and put it under /usr/bin (so iconv is there). Yet it still complains...I don't get it. I've spend the best part of a day mucking around with this to

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread Claude Heiland-Allen
On 23/10/10 17:42, Gregory Crosswhite wrote: On 10/23/10 7:54 AM, John Lato wrote: On Fri, Oct 22, 2010 at 6:16 PM, Bulat Ziganshin bulat.zigans...@gmail.com mailto:bulat.zigans...@gmail.com wrote: Hello John, Monday, October 18, 2010, 8:15:42 PM, you wrote: If anyone is listening, I would

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread Gregory Crosswhite
On 10/23/10 12:57 PM, Claude Heiland-Allen wrote: On 23/10/10 17:42, Gregory Crosswhite wrote: On 10/23/10 7:54 AM, John Lato wrote: On Fri, Oct 22, 2010 at 6:16 PM, Bulat Ziganshin This doesn't work, which was why the OP asked in the first place. When a thread calls an unsafe foreign

Re[2]: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread Bulat Ziganshin
Hello Claude, Saturday, October 23, 2010, 11:57:23 PM, you wrote: Is that true? The last time we discussed this in Haskell Cafe the conclusion I drew from the discussion was that unsafe foreign functions block the current thread but not any other thread. The conclusion I drew was that

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread Alexey Khudyakov
On 23.10.2010 05:11, wren ng thornton wrote: On 10/22/10 8:46 AM, Alexey Khudyakov wrote: Hello everyone! It's well known that Num Co type classes are not adequate for vectors (I don't mean arrays). I have an idea how to address this problem. Conal Elliott wrote very nice set of type classes

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread Gregory Collins
Alexey Khudyakov alexey.sklad...@gmail.com writes: However when written this way it becomes obvious that `zeroV' == `mempty' and ^+^ = mappend. Is Additive really needed then? If your type is a ring, you have two monoids; how would you choose? G -- Gregory Collins g...@gregorycollins.net

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread Daniel Fischer
On Saturday 23 October 2010 22:53:32, Alexey Khudyakov wrote: type family Scalar :: * - * class Additive v = LeftModule v where   (*^) :: Scalar v - v - v class Additive v = RightModule v where   (^*) :: v - Scalar v - v Could you give some example of data type for which (*^) ≠

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread Daniel Peebles
Just out of curiosity, why do you (and many others I've seen with similar proposals) talk about additive monoids? are they somehow fundamentally different from multiplicative monoids? Or is it just a matter of notation? When I was playing with building an algebraic hierarchy, I picked a neutral

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread Alexey Khudyakov
On 24.10.2010 01:19, Daniel Peebles wrote: Just out of curiosity, why do you (and many others I've seen with similar proposals) talk about additive monoids? are they somehow fundamentally different from multiplicative monoids? Or is it just a matter of notation? When I was playing with building

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread Jacques Carette
On 23/10/2010 5:19 PM, Daniel Peebles wrote: Just out of curiosity, why do you (and many others I've seen with similar proposals) talk about additive monoids? are they somehow fundamentally different from multiplicative monoids? People usually use additive notation for commutative monoids,

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread Donn Cave
Quoth Claude Heiland-Allen claudiusmaxi...@goto10.org, ... The conclusion I drew was that unsafe foreign functions block the current capability (OS thread) and any threads (Haskell forkIO etc) currently scheduled on that capability, but other capabilities and threads continue executing as

[Haskell-cafe] back doors into the IO monad

2010-10-23 Thread Manlio Perillo
Hi. What are the available methods to execute IO actions from pure code? I know only unsafePerformIO and foreign import (to call a non pure foreign function). Assuming I want to execute external untrusted code using plugins (via the `plugins` package), is it possible to completely forbid

Re: [Haskell-cafe] back doors into the IO monad

2010-10-23 Thread Claude Heiland-Allen
On 23/10/10 23:28, Manlio Perillo wrote: Hi. What are the available methods to execute IO actions from pure code? I know only unsafePerformIO and foreign import (to call a non pure foreign function). Assuming I want to execute external untrusted code using plugins (via the `plugins`

Re: [Haskell-cafe] Bug in HTTP (bad internal error handling)

2010-10-23 Thread Bit Connor
On Sat, Oct 23, 2010 at 8:49 PM, Ganesh Sittampalam gan...@earth.li wrote: Hi Bit, On Thu, 21 Oct 2010, Bit Connor wrote: On Sat, Oct 16, 2010 at 10:29 AM, Claus Reinke claus.rei...@talk21.com wrote: After it catches this error, the function returns (line 376): return (fail (show e))

Re: [Haskell-cafe] Redy to release gtk2hs-0.12.0!

2010-10-23 Thread Bit Connor
On Sat, Oct 23, 2010 at 12:40 PM, Andy Stewart lazycat.mana...@gmail.com wrote: * Support newest GIO library (Cross platform file APIs)  You can use GIO develop cross-platform file-manager, like this :  http://www.flickr.com/photos/48809...@n02/4793031888/lightbox/ Wow. That looks like a

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread wren ng thornton
On 10/23/10 2:33 PM, Brandon S Allbery KF8NH wrote: I think they mean please don't conflate `reentrant' with `blocking' in the FFI. Not knowing much about the guts of GHC's implementation of the FFI, I wonder if there would actually be an implementational difference in distinguishing

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread wren ng thornton
On 10/23/10 4:53 PM, Alexey Khudyakov wrote: On 23.10.2010 05:11, wren ng thornton wrote: I'd rather see, class Additive v where -- or AdditiveMonoid, if preferred zeroV :: v (^+^) :: v - v - v class Additive v = AdditiveGroup v where negateV :: v - v Seems good for me. One more instance

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread wren ng thornton
On 10/23/10 5:19 PM, Daniel Peebles wrote: Just out of curiosity, why do you (and many others I've seen with similar proposals) talk about additive monoids? are they somehow fundamentally different from multiplicative monoids? Or is it just a matter of notation? When I was playing with building

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread wren ng thornton
On 10/23/10 7:52 PM, wren ng thornton wrote: I'd argue that neither usage is primary, and therefore the best solution is actually to have three classes (neutral, additive, and multiplicative) with two functors (additive-neutral, multiplicative-neutral) to connect them[1].[...] [1] the Exp/Log

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread Brandon Moore
On Oct 23, 2010, at 2:57 PM, Claude Heiland-Allen claudiusmaxi...@goto10.org wrote: On 23/10/10 17:42, Gregory Crosswhite wrote: On 10/23/10 7:54 AM, John Lato wrote: On Fri, Oct 22, 2010 at 6:16 PM, Bulat Ziganshin bulat.zigans...@gmail.com mailto:bulat.zigans...@gmail.com wrote: Hello John,

Re: [Haskell-cafe] Haskellers design

2010-10-23 Thread Paul Brauner
Looks perfect to me. Go for it! PS: I'm reading your book, I have never tried web dev before but Yesod feels very right On Sat, Oct 23, 2010 at 08:09:25PM +0200, Michael Snoyman wrote: It looks good to me. Are there any objections to using this for Haskellers? On Sat, Oct 23, 2010 at 3:31

Re: [Haskell-cafe] Error Calling Lua Function

2010-10-23 Thread aditya siram
That worked. Thank you! -deech On Sat, Oct 23, 2010 at 1:49 PM, Claude Heiland-Allen claudiusmaxi...@goto10.org wrote: Hi Aditya, The problem is not that the file was not loaded, but that in Lua, loading a file only loads it and does not execute it; Lua is a dynamic language, by which I

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread Sebastian Fischer
On Oct 24, 2010, at 8:52 AM, wren ng thornton wrote: But then, how should we decide whether the additive or multiplicative structure is more neutral? On Oct 24, 2010, at 7:08 AM, Jacques Carette wrote: People usually use additive notation for commutative monoids, and multiplicative

[Haskell-cafe] Splay tree in a pattern matching way

2010-10-23 Thread Xinyu LIU
Hi, I checked the Hackage Splay Tree implementation from. http://hackage.haskell.org/packages/archive/TreeStructures/0.0.1/doc/html/src/Data-Tree-Splay.html#SplayTree Basically it's based on the strategy mentioned in Okasaki's ``Purely Functional Programming'', Chapter 5.4. That in case we

Re: [Haskell-cafe] Haskellers design

2010-10-23 Thread Michael Snoyman
Cool, I'm glad you like it. Just as an FYI, I'm going to be moving some of the information around soon (I finally wrote a proper outline for the book), so it may be a bit confusing one day ;). Michael On Sun, Oct 24, 2010 at 3:56 AM, Paul Brauner paul.brau...@loria.fr wrote: Looks perfect to

[Haskell-cafe] Converting Values Between Lua And Haskell

2010-10-23 Thread aditya siram
Hi all, The HsLua page [1] says that Int,Double,String,Bool,[a] and [(a,b)] types can be converted to and from Lua values. However the on hslua API page I don't see a StackValue instance [2] for [a] or [(a,b)]. Am I missing something? -deech [1]