Re: [Haskell-cafe] GHC devs

2009-10-16 Thread Martijn van Steenbergen
David Virebayre wrote: Taking the opportunity to thank very much both Simons and Ian for the work they do and the enthusiasm they show. You guys rock. I heartily second that! Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: Relational Algebra

2009-10-16 Thread oleg
In hindsight it occurred to me that the algorithm can be abstractly expressed in terms of relational algebra for which I need an EDSL. One concrete implementation could then be an interpreter / compiler to SQL, if I choose to use a database backend, and another implementation could be a

[Haskell-cafe] ANN: WFLP 2010 Call for papers

2009-10-16 Thread Pablo Nogueira
[Apologies for multiple receptions of this message] Preliminary Call For Papers 19th International Workshop on Functional and (Constraint) Logic Programming

[Haskell-cafe] How to reliably open and close resources in MonadIO in the presence of exceptions?

2009-10-16 Thread Bas van Dijk
import Control.Monad.Trans ( MonadIO, liftIO ) import Control.Exception ( throwIO, ArithException(DivideByZero), onException ) import Foreign.Marshal.Alloc ( malloc, free ) import Foreign.Storable ( poke, peek ) Suppose we define a function which receives a computation in an

Re: [Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Deniz Dogan
2009/10/16 Gregory Crosswhite gcr...@phys.washington.edu: In my humble opinion, one of the best editors for development of all time is Leo:        http://webpages.charter.net/edreamleo/front.html Leo takes the idea of code folding and gives you complete control over it.  That is, unlike

[Haskell-cafe] Why there is not standard Monoid instance for ZipList a?

2009-10-16 Thread Vladimir Reshetnikov
I find the following instance very convenient: import Data.Monoid import Control.Applicative instance Monoid a = Monoid (ZipList a) where mempty = pure mempty mappend = liftA2 mappend

[Haskell-cafe] Re: How to reliably open and close resources in MonadIO in the presence of exceptions?

2009-10-16 Thread Bas van Dijk
On Fri, Oct 16, 2009 at 11:15 AM, Bas van Dijk v.dijk@gmail.com wrote: import Control.Monad.Trans   ( MonadIO, liftIO ) import Control.Exception     ( throwIO, ArithException(DivideByZero), onException ) import Foreign.Marshal.Alloc ( malloc, free ) import Foreign.Storable      ( poke,

Re: [Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Peter Verswyvelen
If you're a Windows developer and don't want to spent time to learn all the alien emacs keyboard shortcuts, you can get going quickly by using this emacs patch: http://ourcomments.org/Emacs/EmacsW32.html http://ourcomments.org/Emacs/EmacsW32.htmlThen use set all to Emacs!W32 and your keys behave

Re: [Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Rafael Gustavo da Cunha Pereira Pinto
Real programmers use butterflies!! http://xkcd.com/378/ The best editor is the one that suites YOU better. I use VIM, even in Windows, but that's me! Best regards, Rafael On Fri, Oct 16, 2009 at 07:32, Peter Verswyvelen bugf...@gmail.com wrote: If you're a Windows developer and don't want

[Haskell-cafe] Merging modules

2009-10-16 Thread pat browne
Hi, I want to establish the strengths and weakness of the Haskell module system for the ontology merging task (I know it was not designed for this!). I wish to make a new module (MERGEDONTOLOGY) from three input modules one of which is common to the other two. The desired merge should contain the

RE: [Haskell-cafe] Re: How to reliably open and close resources inMonadIO in the presence of exceptions?

2009-10-16 Thread Bayley, Alistair
-Original Message- From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Bas van Dijk I could of course write a genAlloca if the MonadIO class was extended with a bracket method: Besides extending MonadIO with bracket, maybe it's also

Re: [Haskell-cafe] Merging modules

2009-10-16 Thread mf-hcafe-15c311f0c
On Fri, Oct 16, 2009 at 11:42:22AM +0100, pat browne wrote: To: haskell-cafe@haskell.org From: pat browne patrick.bro...@comp.dit.ie Date: Fri, 16 Oct 2009 11:42:22 +0100 Subject: [Haskell-cafe] Merging modules Hi, I want to establish the strengths and weakness of the Haskell module

Re: [Haskell-cafe] Merging modules

2009-10-16 Thread pat browne
This is all pretty basic stuff. Not sure any of it is very helpful. (Why do you want to spread an ontology over several Haskell modules?) -matthias Yes it is very helpful, I have limited time to study Haskell. The reason for spreading the information over modules is to simulate actual

Re: [Haskell-cafe] Why there is not standard Monoid instance for ZipList a?

2009-10-16 Thread Job Vranish
Nope, Other than possibly adding library clutter. I have a package that provides many instances and common functions for ZipLists. Eventually I might stick it on hackage, but currently it's here: http://github.com/jvranish/ZipList I really with there was a way to switch Applicative (or other)

Re: [Haskell-cafe] Merging modules

2009-10-16 Thread mf-hcafe-15c311f0c
On Fri, Oct 16, 2009 at 12:56:30PM +0100, pat browne wrote: To: haskell-cafe@haskell.org From: pat browne patrick.bro...@comp.dit.ie Date: Fri, 16 Oct 2009 12:56:30 +0100 Subject: Re: [Haskell-cafe] Merging modules This is all pretty basic stuff. Not sure any of it is very helpful.

[Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread JP Moresmau
Hello I've been working on eclipse-fp to bring it up to working order again, so if you like Eclipse, you can download the source from git://github.com/JPMoresmau/eclipsefp.git (hopefully there will be a binary release soon). This is based on my customized Scion library

[Haskell-cafe] ANN: Haskell Hackathon in Zurich, Switzerland

2009-10-16 Thread Johan Tibell
Hi all! We are in the early stages of planning a Haskell hackathon/get together, ZuriHac, to be held this March at the Google office, in Zurich, Switzerland. Right now we're looking at four possible dates (Friday-Sunday): March 5-7, March 12-14, March 19-21, or March 26-28. If you

[Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Stefan Monnier
Real programmers use butterflies!! In Emacs-23, this is available as M-x butterfly C-M-c Too bad it wasn't around when I was writing my thesis, Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Lecture Notes Advanced Functional programming available

2009-10-16 Thread S. Doaitse Swierstra
I am happy to announce that the rworked lecture notes for the 6th Advance Functional programming summer school have become available. For further information about the lecture notes:

Re: [Haskell-cafe] Re: How to reliably open and close resources inMonadIO in the presence of exceptions?

2009-10-16 Thread Bas van Dijk
On Fri, Oct 16, 2009 at 1:16 PM, Bayley, Alistair alistair.bay...@invesco.com wrote: You might want this library: http://hackage.haskell.org/packages/archive/MonadCatchIO-transformers/0. 0.1.0/doc/html/Control-Monad-CatchIO.html Thanks, this is exactly what I need! regards, Bas

Re: [Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Paulo Tanimoto
On Thu, Oct 15, 2009 at 9:19 PM, Stefan Monnier monn...@iro.umontreal.ca wrote: The only thing I haven't figured out is how to do tab-completion of words in the ghci buffer.  Do I need to use a different key combination?  I couldn't find that in the documentation. I think it's just a missing

[Haskell-cafe] Merging classes

2009-10-16 Thread pat browne
Hi, Following on from my earlier *Merging modules* email, where I tried to simulate ontology merging with Haskell modules; http://article.gmane.org/gmane.comp.lang.haskell.cafe/64943 I *think* that the type of merging that I am attempting is difficult with modules so I gave classes a try. I did

Re: [Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Gregory Crosswhite
While Emacs has some outline capabilities, they are not at this time remotely as nice or as powerful as Leo, which among other things: *) does not require that you manually specify the depth of each node *) can automatically concatenate child nodes together so that you don't have to

[Haskell-cafe] package name in TypeRep?

2009-10-16 Thread Johannes Waldmann
Dear all, I want a function that produces the URL of the haddocumentation of a given type, generically. My solution is that the argument (type) is an instance of Data.Typeable and I am parsing the output of show of the TypeRep, cf.

[Haskell-cafe] x - String

2009-10-16 Thread Andrew Coppin
Is there any way that you can turn an arbitrary Haskell value into a string? I rephrase: There *is* a way to turn arbitrary values into strings. I know there is, because the GHCi debugger *does* it. The question is, does anybody know of an /easy/ way to do this? Basically, I'm writing a

Re: [Haskell-cafe] x - String

2009-10-16 Thread David Virebayre
On Fri, Oct 16, 2009 at 8:19 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Is there any way that you can turn an arbitrary Haskell value into a string? I rephrase: There *is* a way to turn arbitrary values into strings. I know there is, because the GHCi debugger *does* it. The question

Re: [Haskell-cafe] x - String

2009-10-16 Thread Andrew Coppin
David Virebayre wrote: On Fri, Oct 16, 2009 at 8:19 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Is there any way that you can turn an arbitrary Haskell value into a string? I rephrase: There *is* a way to turn arbitrary values into strings. I know there is, because the

Re: [Haskell-cafe] x - String

2009-10-16 Thread Daniel Peebles
GHCi can't show you functions can it? Unless you have a Show instance for functions loaded. I think the basic answer is no, not even with crazy unsafe stuff, because without the typeclass constraint GHC doesn't know to pass around the secret dictionary containing the methods that tell it how to

Re: [Haskell-cafe] x - String

2009-10-16 Thread Jochem Berndsen
Andrew Coppin wrote: Is there any way that you can turn an arbitrary Haskell value into a string? No, the only values of type a - String are the constant functions and _|_. I rephrase: There *is* a way to turn arbitrary values into strings. I know there is, because the GHCi debugger *does*

Re: [Haskell-cafe] x - String

2009-10-16 Thread Bulat Ziganshin
Hello Andrew, Friday, October 16, 2009, 10:19:46 PM, you wrote: actually print out what's in it. On the other hand, I don't want to alter the entire program to have Show constraints everywhere just so I can print out some debug traces (and then alter everything back again afterwards once I'm

Re: [Haskell-cafe] x - String

2009-10-16 Thread Andrew Coppin
Jochem Berndsen wrote: I rephrase: There *is* a way to turn arbitrary values into strings. I know there is, because the GHCi debugger *does* it. The question is, does anybody know of an /easy/ way to do this? No. GHCi does not always do this: Prelude Data.Ratio let plus1 = (+1) Prelude

Re: [Haskell-cafe] x - String

2009-10-16 Thread Ross Mellgren
Andrew has mentioned the debugger several times, NOT the interactive REPL. That is, using :-commands to inspect values. -Ross On Oct 16, 2009, at 2:46 PM, Daniel Peebles wrote: My GHCi can't do that :o I just wrote data A = B | C and loaded the file into GHCi. Typing B gives me:

[Haskell-cafe] Genuine Need For Persistent Global State?

2009-10-16 Thread Alan Carter
Hi, I've been looking at the patches given by Tom at Beware the Jabberwolk, for building Linux kernel modules in Haskell. Once I'd got Tom's stuff building, the next thing was to build a little driver which actually does something. Step by step I was making progress, and I've now got a little

Re: [Haskell-cafe] Genuine Need For Persistent Global State?

2009-10-16 Thread Don Stewart
alangcarter: 1) Am I right in thinking that I have a genuine need for global, persistent state? 2) Halfs works. Am I right in thinking it has (somehow) solved this problem? 3) Is there a simple way to maintain global persistent state that I can stash between calls into a function, and access

Fwd: [Haskell-cafe] x - String

2009-10-16 Thread Alberto G. Corona
yep add Show to your abstrac container. , for example: data SDynamic= forall a.Show a = SDynamic a instance Show SDynamic where show (SDynamic a)= show a 2009/10/16 David Virebayre dav.vire+hask...@gmail.comdav.vire%2bhask...@gmail.com On Fri, Oct 16, 2009 at 8:19 PM, Andrew Coppin

Re: [Haskell-cafe] Genuine Need For Persistent Global State?

2009-10-16 Thread Job Vranish
Stable pointers might do what you want: http://haskell.org/ghc/docs/latest/html/libraries/base/Foreign-StablePtr.html Though an IORef would probably work just as well, depending on how you needed to use it.. - Job On Fri, Oct 16, 2009 at 2:59 PM, Alan Carter alangcar...@gmail.com wrote: Hi,

Re: [Haskell-cafe] x - String

2009-10-16 Thread Daniel Peebles
Whoops, sorry about that then! On Fri, Oct 16, 2009 at 2:59 PM, Ross Mellgren rmm-hask...@z.odi.ac wrote: Andrew has mentioned the debugger several times, NOT the interactive REPL. That is, using :-commands to inspect values. -Ross On Oct 16, 2009, at 2:46 PM, Daniel Peebles wrote: My

Re: [Haskell-cafe] x - String

2009-10-16 Thread Ross Mellgren
No problem, just trying to make sure the conversation stays on track :-) -Ross On Oct 16, 2009, at 3:26 PM, Daniel Peebles wrote: Whoops, sorry about that then! On Fri, Oct 16, 2009 at 2:59 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: Andrew has mentioned the debugger several times, NOT

Re: [Haskell-cafe] Genuine Need For Persistent Global State?

2009-10-16 Thread Don Stewart
StablePtrs are relatively easy to use, and have precisely the guarantees you need -- the state can be passed to C and recovered. Any use of IORefs that will scale past more than one state object will essentially duplicate the stable pointer functionality. They're a reasonable choice. -- Don

[Haskell-cafe] Generating random enums

2009-10-16 Thread michael rice
What is the minimum I need to do to get this function to generate a three direction tuple? Michael = import System.Random import Data.Ord data Dir     = North     | South     | East     | West     deriving (Show, Read, Eq, Enum, Ord, Bounded) threeDirs :: StdGen -

Re: [Haskell-cafe] Generating random enums

2009-10-16 Thread Ross Mellgren
I didn't try to compile this: import Control.Arrow (first) import System.Random (Random(..)) instance Random Dir where randomR (lo, hi) gen = first fromEnum (randomR (toEnum lo) (toEnum hi) gen) random gen = randomR (minBound, maxBound) But something along those lines should help

Re: [Haskell-cafe] Genuine Need For Persistent Global State?

2009-10-16 Thread Bryan O'Sullivan
On Fri, Oct 16, 2009 at 11:59 AM, Alan Carter alangcar...@gmail.com wrote: Trouble is, my function is (ultimately) being called from the C kernel stuff. It isn't on the bottom of a call graph coming from a Haskell main. A driver really needs to know where it's at. So I seem to need some kind

Re: [Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Stefan Monnier
The only thing I haven't figured out is how to do tab-completion of words in the ghci buffer.  Do I need to use a different key combination?  I couldn't find that in the documentation. I think it's just a missing feature. OK! Let me know if there's anything I can do to help. I noticed that

Fwd: [Haskell-cafe] Re: Best Editor In Windows

2009-10-16 Thread Alberto G. Corona
I use Leksah. It´s an IDE . It works fine in Windows. http://leksah.org/ http://leksah.org/Leksah-0.6.1.0.exe By the way, keep the good work Leksah people !. 2009/10/16 Stefan Monnier monn...@iro.umontreal.ca The only thing I haven't figured out is how to do tab-completion of words in the

Re: [Haskell-cafe] x - String

2009-10-16 Thread Derek Elkins
See vacuum: http://hackage.haskell.org/package/vacuum ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] ANNOUNCE IDynamic-0.1

2009-10-16 Thread Alberto G. Corona
IDynamic is variant of Data.Dynamic that can be indexed, serialized., stored, transmitted trough communications etc. So it can be used in abstract data containers, persistence, communications etc. http://hackage.haskell.org/package/IDynamic I Just uploaded it, so the documentation has not been

[Haskell-cafe] There is no Text.Regex module

2009-10-16 Thread zaxis
In Archlinux i can use Text.Regex as below: import Text.Regex let [y,m,d] = map (\x - read x::Int) $ splitRegex (mkRegex -) dateStr However, in Ubuntu 9.10 it doesnot work reporting no Text.Regex module. So i download and install regex-base and regex-posix from Hackage. But it still doesnot work

Re: [Haskell-cafe] There is no Text.Regex module

2009-10-16 Thread Thomas DuBuisson
Modules come from Haskell packages, most of which can be found on hackage.haskell.org. If you are looking for a module but you don't know which package it comes from then feel free to search using hoogle or hayoo!. Obviously manually checking all the seemingly related packages on hackage is also

Re: [Haskell-cafe] There is no Text.Regex module

2009-10-16 Thread zaxis
Hoogle is great ! thanks! Thomas DuBuisson wrote: Modules come from Haskell packages, most of which can be found on hackage.haskell.org. If you are looking for a module but you don't know which package it comes from then feel free to search using hoogle or hayoo!. Obviously manually

[Haskell-cafe] Haskell Weekly News: Issue 136 - October 17, 2009

2009-10-16 Thread jfredett
--- Haskell Weekly News http://sequence.complete.org/hwn/20091017 Issue 136 - October 17, 2009 --- Welcome to issue 136 of HWN, a newsletter covering

Re: [Haskell-cafe] There is no Text.Regex module

2009-10-16 Thread Erik de Castro Lopo
zaxis wrote: In Archlinux i can use Text.Regex as below: import Text.Regex let [y,m,d] = map (\x - read x::Int) $ splitRegex (mkRegex -) dateStr However, in Ubuntu 9.10 it doesnot work reporting no Text.Regex module If you installed ghc6 from a package you should do: sudo apt-get