[Haskell-cafe] Datastructure with some business-rules

2009-06-03 Thread Mathijs Kwik
Hi all, I'm building a tree-like structure that somewhat resembles a package/ dependency structure as most packagemanagers/ports-systems have them. It's tree-like (Data.Tree at the moment), but I will probably need to make some structural changes to allow for more complex stuff like circular

Re: [Haskell-cafe] ANNOUNCE: The Haskell Platform 2009.2.0.1

2009-06-03 Thread Matthijs Kooijman
Hi Don, We're pleased to announce the second release of the Haskell Platform: a single, standard Haskell distribution for everyone. is there a changelog somewhere? Gr. Matthijs signature.asc Description: Digital signature ___ Haskell-Cafe mailing

[Haskell-cafe] Notice for package authors

2009-06-03 Thread Duncan Coutts
Package authors, We are about to add an additional quality check in the Hackage upload process that will affect many packages. Hackage will require an upper bound on the version of the base package and reject packages that omit it. Lots of packages currently specify: build-depends: base

Re: [Haskell-cafe] HXT XmlPicklers - TH Derivation

2009-06-03 Thread Neil Mitchell
Hi Max, I have developed some simple TH code to automatically derive XmlPickler instances for my types and if there is interest, I will clean it up and submit a patch.  Its not complete, but is a start.  Any interest? Why not submit it to derive: http://community.haskell.org/~ndm/derive

Re: [Haskell-cafe] Notice for package authors

2009-06-03 Thread Duncan Coutts
On Wed, 2009-06-03 at 11:36 +0100, Duncan Coutts wrote: Package authors, We are about to add an additional quality check in the Hackage upload process that will affect many packages. Hackage will require an upper bound on the version of the base package and reject packages that omit it.

[Haskell-cafe] GHCI Curl under Windows

2009-06-03 Thread Martin Huschenbett
Hi Haskellers, I've installed the newest Haskell Platform under Vista and downloaded a pre compiled version of curl-7.19.4 for MinGW. After changing the build type in curl.cabal to Simple and supplying the needed paths I could even build and install curl for haskell. If I write a program

[Haskell-cafe] Functors and the Visitor Pattern

2009-06-03 Thread Tom.Amundsen
So, last night, I was having this problem with my Java code where I couldn't figure out for the life of me how to write a piece of code without a big if {} else if {} else if {} ... else {} structure. I was Googling Java Reflection to try to determine how to cast to the most concerete subclass at

[Haskell-cafe] ANN: heap-1.0.0

2009-06-03 Thread Stephan Friedrichs
Hello haskell-cafe, I'm pleased to announce a rewrite of the heap package, heap-1.0.0 [1]. It is not 100% compatible to the version 0.6.0, but provides major improvements: - The HeapPolicy type class hack used to distinguish between min- max-, min-prio- and max-prio-heaps has been replaced

Re: [Haskell-cafe] Cabal/primes

2009-06-03 Thread michael rice
OK, I downloaded Numbers. Still missing the three functions I wanted, which are primes, isPrime, and isProbablyPrime. How do I get these? Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Functors and the Visitor Pattern

2009-06-03 Thread Andres Loeh
Although, now I'm second guessing myself, because I can't figure out how we could create some design pattern that simulates an applicative functor. I'm pretty sure the Visitor pattern doesn't take you this far (but I am willing to be corrected). So, is there a way to create applicative

[Haskell-cafe] GSoC update: sneak peek at the live heap profiler

2009-06-03 Thread Patai Gergely
Hello everyone, finally there's a bit of eye candy for anyone interested in the heap profiling project: http://just-bottom.blogspot.com/ Feel encouraged to comment and check out the project page too, where you can already see the beginnings of the core library. Gergely --

Re: [Haskell-cafe] GSoC update: sneak peek at the live heap profiler

2009-06-03 Thread Neil Mitchell
Hi Gergely, I haven't seen this blog on planet.haskell.org, but it definitely should be! Instructions on how to have it added are on that page. Thanks, Neil 2009/6/3 Patai Gergely patai_gerg...@fastmail.fm: Hello everyone, finally there's a bit of eye candy for anyone interested in the heap

Re: [Haskell-cafe] Cabal/primes

2009-06-03 Thread brian
Prelude :m + Data.Numbers.Primes Prelude Data.Numbers.Primes :browse isPrime :: Integer - Bool isProbablyPrime :: (System.Random.RandomGen g) = Integer - g - (Bool, g) primes :: [Integer] Prelude Data.Numbers.Primes isPrime 3525266 Loading package syb ... linking ... done. Loading package

Re: [Haskell-cafe] GSoC update: sneak peek at the live heap profiler

2009-06-03 Thread Patai Gergely
I haven't seen this blog on planet.haskell.org, but it definitely should be! Instructions on how to have it added are on that page. Yes, I did that not long after starting the blog. Maybe someone should flush the queue. ;) -- http://www.fastmail.fm - The way an email service should be

Re: [Haskell-cafe] GHCI Curl under Windows

2009-06-03 Thread Sigbjorn Finne
On Wed, 03 Jun 2009 05:27:53 -0700, Martin Huschenbett hus...@gmx.org wrote: Hi Haskellers, I've installed the newest Haskell Platform under Vista and downloaded a pre compiled version of curl-7.19.4 for MinGW. After changing the build type in curl.cabal to Simple and supplying the

Re: [Haskell-cafe] type checking that I can't figure out ....

2009-06-03 Thread Michael Snoyman
On Wed, Jun 3, 2009 at 8:42 AM, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Mittwoch 03 Juni 2009 06:12:46 schrieb Michael Snoyman: I made two changes: 1. You had the arguments to M.lookup backwards. 2. lookup does not return any generalized Monad, just Maybe (I think that should

Re: [Haskell-cafe] Functors and the Visitor Pattern

2009-06-03 Thread Edward Kmett
The concepts are fairly closely related but each entails something the other does not. Functor entails parametric polymorphism with respect to the contents of the container. And a visitor can extract a result from the traversal. As a result you may want to think in terms of a Traversable or

Re: [Haskell-cafe] GSoC update: sneak peek at the live heap profiler

2009-06-03 Thread Jochem Berndsen
Patai Gergely wrote: Hello everyone, finally there's a bit of eye candy for anyone interested in the heap profiling project: http://just-bottom.blogspot.com/ Feel encouraged to comment and check out the project page too, where you can already see the beginnings of the core library.

Re: [Haskell-cafe] GSoC update: sneak peek at the live heap profiler

2009-06-03 Thread Malcolm Wallace
I haven't seen this blog on planet.haskell.org, but it definitely should be! ... Yes, I did that not long after starting the blog. Maybe someone should flush the queue. ;) There are other requests from GSoC students to join planet.haskell.org, also still stuck in the queue. (I have

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-06-03 Thread Henning Thielemann
Claus Reinke wrote: Do you argue that overloading logical operations like this in Haskell sacrifices type safety? Could programs go wrong [1] that use such abstractions? If I understand your point correctly, you are suggesting that such programs are still type safe. I agree with the claim

[Haskell-cafe] understanding regex libs

2009-06-03 Thread Simon Michael
Hi Chris.. thanks for your extensive work on haskell regex libs. I'm looking for a good way to make my regex-using app more portable to windows. I couldn't figure out the difference between the regex-pcre and regex- pcre-builtin on hackage. Could you clarify ? Best regards, -Simon

Re: [Haskell-cafe] understanding regex libs

2009-06-03 Thread Don Stewart
simon: Hi Chris.. thanks for your extensive work on haskell regex libs. I'm looking for a good way to make my regex-using app more portable to windows. I couldn't figure out the difference between the regex-pcre and regex- pcre-builtin on hackage. Could you clarify ? pcre-builtin ships

[Haskell-cafe] Re: ANNOUNCE: The Haskell Platform 2009.2.0.1

2009-06-03 Thread Simon Michael
Thanks a lot to all working on this. This is just a small experience report. I successfully installed the HP on a borrowed windows XP professional, version 5.1.2600. It was very smooth. It felt like a largeish install; I was glad I had a fast link. Afterward I had a GHC submenu in start menu -

Re: [Haskell-cafe] GSoC update: sneak peek at the live heap profiler

2009-06-03 Thread Patai Gergely
Seems pretty cool :) Will this graph be interactive during the run of the program? What kind of interaction do you have in mind? I intend to add at least zooming-panning, filtering and a few different views (at least independent cost centres like now and cumulative modes like hp2ps). (I tried

[Haskell-cafe] Re: understanding regex libs

2009-06-03 Thread Simon Michael
pcre-builtin ships the PCRE C library internally. Regular regex-pcre relies on the DLL somewhere on your system. Thanks, this sounds like what I need for windows installability. Maybe this should be mentioned in regex-pcre-builtin's hackage page and haddock docs. Is there any downside to

[Haskell-cafe] type checking that I can't figure out ...

2009-06-03 Thread Vasili I. Galchin
Hi Andrew (Bromage), I reversed the parameter order to Data.Map.lookup and calling fromJust to pull out value from Maybe wrapper ... all as you suggested: remLookupFwd :: (ReVars m t) = SimplRe t - ReM m t (ReInfo t) remLookupFwd re = do fwd - gets resFwdMap let { Just

Re: [Haskell-cafe] type checking that I can't figure out ...

2009-06-03 Thread Ross Mellgren
You've applied two solutions to get the value out -- pattern matching (Just reinfo) and fromJust. You should use one or the other, but not both: -- pattern matching remLookupFwd :: (ReVars m t) = SimplRe t - ReM m t (ReInfo t) remLookupFwd re = do fwd - gets resFwdMap let { Just

Re: [Haskell-cafe] Functors and the Visitor Pattern

2009-06-03 Thread Daryoush Mehrtash
There was a google talk on Visitor pattern in Java and Common Lisp that you might find interesting http://www.youtube.com/watch?v=VeAdryYZ7ak Daryoush On Wed, Jun 3, 2009 at 6:10 AM, Tom.Amundsen tomamund...@gmail.com wrote: So, last night, I was having this problem with my Java code where I

[Haskell-cafe] measure a function in ghci

2009-06-03 Thread Nico Rolle
hi there is there a quick way to check which function is doing the job quicker? i have 2 functions which i want to compare. both give the same output but they do it in different manner. i want to test which one is faster. i use ghci. thanks regards

[Haskell-cafe] Using type families to define runtime representation and evaluation strategy?

2009-06-03 Thread Corey O'Connor
I'm interested in the feasibility of extending the compiler using a construct similar to type synonym families to determine runtime representation and evaluation strategy for types. Can anybody point me to existing work in this area? I'm not sure of the exact terminology to be using here so my

Re: [Haskell-cafe] measure a function in ghci

2009-06-03 Thread Jochem Berndsen
Nico Rolle wrote: is there a quick way to check which function is doing the job quicker? i have 2 functions which i want to compare. both give the same output but they do it in different manner. i want to test which one is faster. i use ghci. For simple testing in the interactive

Re: [Haskell-cafe] measure a function in ghci

2009-06-03 Thread Jason Dagit
On Wed, Jun 3, 2009 at 11:47 AM, Nico Rolle nro...@web.de wrote: hi there is there a quick way to check which function is doing the job quicker? i have 2 functions which i want to compare. both give the same output but they do it in different manner. i want to test which one is faster. i

Re: [Haskell-cafe] Linkage errors in scenegraph

2009-06-03 Thread Gregory D. Weber
Thank you very much. Adding these lines to scenegraph.cabal makes it work: other-modules: Graphics.SceneGraph.Matrix Graphics.SceneGraph.MySTM Graphics.SceneGraph.ReadImage Graphics.SceneGraph.TGA Graphics.SceneGraph.Utils I've contacted the author, who seems

Re: [Haskell-cafe] measure a function in ghci

2009-06-03 Thread Daniel Peebles
Just use unamb[1] and let the program decide which to use at runtime! Just kidding, but only sort of :) Dan [1] http://www.haskell.org/haskellwiki/Unamb On Wed, Jun 3, 2009 at 2:47 PM, Nico Rolle nro...@web.de wrote: hi there is there a quick way to check which function is doing the job

Re: [Haskell-cafe] Cabal/primes

2009-06-03 Thread michael rice
This is working differently than it did last night, when at least import was working. Michael [mich...@localhost ~]$ ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package

[Haskell-cafe] comprehension problem

2009-06-03 Thread ptrash
Hi, what does this to code rows mean: newtype Probability = P Float newtype Dist a = D {unD :: [(a, Probability)]} newtype definies a new type called Probability. But what does P Float mean? And what is the a in Dist a? What does D {...} mean? Thanks for your help. -- View this message in

Re: [Haskell-cafe] Using type families to define runtime representation and evaluation strategy?

2009-06-03 Thread Don Stewart
coreyoconnor: I'm interested in the feasibility of extending the compiler using a construct similar to type synonym families to determine runtime representation and evaluation strategy for types. Can anybody point me to existing work in this area? There's a lot of work on controlling data

Re: [Haskell-cafe] ANN: new version of uu-parsinglib

2009-06-03 Thread Edward Kmett
On Sun, May 31, 2009 at 7:21 PM, Ross Paterson r...@soi.city.ac.uk wrote: Perhaps we should make some and many methods of Alternative, * and * methods of Applicative and $ a method of Functor, all with the current definitions as defaults. (John Meacham was also asking for the first of

Re: [Haskell-cafe] comprehension problem

2009-06-03 Thread Ross Mellgren
P Float is the constructor to create a value of this type, similar to data declarations. That is, 0.5 :: Float, P 0.5 :: Probability The {} notation after D creates a record accessor, also similar to data declarations. It's equivalent to making an unD that unwraps the value yourself:

Re: [Haskell-cafe] Cabal/primes

2009-06-03 Thread michael rice
Got it working. I downloaded two packages, primes and Numbers. Since Numbers has the three functions I want to use, primes, isPrime and isProbablyPrime, how do I uninstall the primes package so there won't be a conflict? Michael = [mich...@localhost hackage.haskell.org]$

Re: [Haskell-cafe] Using type families to define runtime representation and evaluation strategy?

2009-06-03 Thread Corey O'Connor
On Wed, Jun 3, 2009 at 1:09 PM, Don Stewart d...@galois.com wrote: coreyoconnor: I'm interested in the feasibility of extending the compiler using a construct similar to type synonym families to determine runtime representation and evaluation strategy for types. Can anybody point me to

Re: [Haskell-cafe] Using type families to define runtime representation and evaluation strategy?

2009-06-03 Thread Wouter Swierstra
On 3 Jun 2009, at 20:49, Corey O'Connor wrote: I'm interested in the feasibility of extending the compiler using a construct similar to type synonym families to determine runtime representation and evaluation strategy for types. Can anybody point me to existing work in this area? You may

Re: [Haskell-cafe] type checking that I can't figure out ...

2009-06-03 Thread Henning Thielemann
Ross Mellgren schrieb: You've applied two solutions to get the value out -- pattern matching (Just reinfo) and fromJust. You should use one or the other, but not both: -- pattern matching remLookupFwd :: (ReVars m t) = SimplRe t - ReM m t (ReInfo t) remLookupFwd re = do fwd - gets

Re: [Haskell-cafe] type checking that I can't figure out ...

2009-06-03 Thread Ross Mellgren
True, so perhaps better written as: import Data.Maybe (fromMaybe) gets (fromMaybe (error could not find re in resFwdMap) . M.lookup re . resFwdMap) with more detail in error message as appropriate. -Ross On Jun 3, 2009, at 5:57 PM, Henning Thielemann wrote: Ross Mellgren schrieb:

[Haskell-cafe] ANN: atom-0.0.5

2009-06-03 Thread Tom Hawkins
A few bug fixes and doc improvements. Thanks to John Van Enk and Brian Lewis for the patches! http://hackage.haskell.org/cgi-bin/hackage-scripts/package/atom -Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Cabal/primes

2009-06-03 Thread Don Stewart
nowgate: Got it working. I downloaded two packages, primes and Numbers. Since Numbers has the three functions I want to use, primes, isPrime and isProbablyPrime, how do I uninstall the primes package so there won't be a conflict? Easy! $ ghc-pkg unregister primes -- Don

Re: [Haskell-cafe] Cabal/primes

2009-06-03 Thread michael rice
Excellent! Thanks. Michael --- On Wed, 6/3/09, Don Stewart d...@galois.com wrote: From: Don Stewart d...@galois.com Subject: Re: [Haskell-cafe] Cabal/primes To: michael rice nowg...@yahoo.com Cc: brian bri...@aracnet.com, haskell-cafe@haskell.org Date: Wednesday, June 3, 2009, 6:40 PM

Re: [Haskell-cafe] type checking that I can't figure out ....

2009-06-03 Thread Bertram Felgenhauer
Michael Snoyman wrote: On Wed, Jun 3, 2009 at 8:42 AM, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Mittwoch 03 Juni 2009 06:12:46 schrieb Michael Snoyman: 2. lookup does not return any generalized Monad, just Maybe (I think that should be changed). Data.Map.lookup used to

Re: [Haskell-cafe] type checking that I can't figure out ....

2009-06-03 Thread Daniel Peebles
It seems like if we could get fail out of Monad and into something like MonadFail/Zero, then it might make sense to make a lookup that returned an instance of that instead? Dan On Wed, Jun 3, 2009 at 8:13 PM, Bertram Felgenhauer bertram.felgenha...@googlemail.com wrote: Michael Snoyman wrote:

[Haskell-cafe] ANN: HSH 2.0.0

2009-06-03 Thread John Goerzen
Hi, I'm pleased to announce the release of version 2.0.0 of HSH, the Haskell shell scripting library. This version features a complete rewrite of the core. Since System.Process has finally become capable enough to be the low-level of HSH, HSH has been reimplemented in terms of it. This has

Re: [Haskell-cafe] GHCI Curl under Windows

2009-06-03 Thread John Lask
The issue you are experiencing is the result of ghci not using import libraries to resolve external symbols. Just a bit of explanation for reference, which will also help you understand the solution to your problem. Take for example the function declared as int myexport(int x){...} when

Re: [Haskell-cafe] type checking that I can't figure out ....

2009-06-03 Thread Antoine Latter
On Wed, Jun 3, 2009 at 8:52 PM, Daniel Peebles pumpkin...@gmail.com wrote: It seems like if we could get fail out of Monad and into something like MonadFail/Zero, then it might make sense to make a lookup that returned an instance of that instead? Dan Do you mean splitting up

[Haskell-cafe] cabalizing legacy' source

2009-06-03 Thread Vasili I. Galchin
Hello, I have cabalizing some legacy Haskell source. By legacy, I totally don't mean in a pejorative sense ... code has been designed and written well. I am making good progress ... I have succeeded in building an archive file(library) on a POSIX platform, i.e. Linux. The original author

[Haskell-cafe] Re: cabalizing legacy' source

2009-06-03 Thread Vasili I. Galchin
BTW there is no Test directory and also no CLI directory I am pretty familiar with cabal but not as much with Unix Makefile. Probably I need to restructure source directory tree ... to have library source in one subtree, tests in another CLI executables in a third BUT can I set up cabal files

Re: [Haskell-cafe] type checking that I can't figure out ....

2009-06-03 Thread Daniel Peebles
Yeah, in a way similar to ArrowPlus/ArrowZero. Then again, I'm not sure whether it would be meaningful to split up MonadPlus like that. On Thu, Jun 4, 2009 at 12:40 AM, Antoine Latter aslat...@gmail.com wrote: On Wed, Jun 3, 2009 at 8:52 PM, Daniel Peebles pumpkin...@gmail.com wrote: It seems

[Haskell-cafe] Scary type inference for monadic function definitions

2009-06-03 Thread Ahn, Ki Yung
Scary type inference for monadic function definitions (or, why you'd want to annotate types for monadic function definitions) This is a real example that I've experienced. I defined the following function. checkOneVerseByLineWith readLine v = do mg - readLine case mg of Just g

[Haskell-cafe] Re: Scary type inference for monadic function definitions

2009-06-03 Thread Ahn, Ki Yung
Ahn, Ki Yung 쓴 글: Scary type inference for monadic function definitions (or, why you'd want to annotate types for monadic function definitions) This is a real example that I've experienced. I defined the following function. checkOneVerseByLineWith readLine v = do mg - readLine