Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-22 Thread Miguel Mitrofanov
22.02.2012, 11:20, wren ng thornton w...@freegeek.org: On 2/22/12 1:45 AM, Miguel Mitrofanov wrote:  However, there is no free ordering on:    { (a0,b) | b- B } \cup { (a,b0) | a- A }  What? By definition, since, a0= a and b0= b, we have (a0, b0)= (a0, b) and (a0, b0)= (a0, b0), so,

[Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Eugene Kirpichov
Hi, I'd like my program to print something like this is $program 1.0.4 git 45fea6b when invoked with --version, or at least just the 1.0.4 part. Can Cabal expose the version as a preprocessor macro by default, or do I have to use Build-Type: Custom and add a preprocessing step of my own? --

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Roel van Dijk
For each package myPackage Cabal generates a module containing, among other things, the package's version as a Haskell value: import Paths_myPackage ( version ) import Data.Version ( showVersion ) main = showVersion version See also Accessing data files from package code in

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-22 Thread wren ng thornton
On 2/22/12 2:20 AM, wren ng thornton wrote: On 2/22/12 1:45 AM, Miguel Mitrofanov wrote: However, there is no free ordering on: { (a0,b) | b - B } \cup { (a,b0) | a - A } What? By definition, since, a0 = a and b0 = b, we have (a0, b0) = (a0,b) and (a0, b0) = (a0, b0), so, (a0, b0) is clearly

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Eugene Kirpichov
Thanks, this is exactly what I was looking for! I might look some more into exposing VCS tags too, however. On Wed, Feb 22, 2012 at 12:25 PM, Roel van Dijk vandijk.r...@gmail.comwrote: For each package myPackage Cabal generates a module containing, among other things, the package's version as

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Michael Snoyman
I have a project at work that embeds the Mercurial version in the final executable. I use Template Haskell to call the hg executable and parse its output. Here's the relevant code snippet: putStrLn $ Mercurial commit: ++ $(do let getChangeset s =

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Eugene Kirpichov
Whoa, I didn't think about using Template Haskell here. Thanks. Perhaps this should be abstracted into a library. On Wed, Feb 22, 2012 at 12:40 PM, Michael Snoyman mich...@snoyman.comwrote: I have a project at work that embeds the Mercurial version in the final executable. I use Template

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-22 Thread wren ng thornton
On 2/22/12 2:37 AM, Dan Doel wrote: unless I'm still sketchy on what you mean by domain. I don't think it matters that we're only considering strict homomorphisms. I think part of the problem is that there are many different ideas of what exact properties a domain has. The one I'm most

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Herbert Valerio Riedel
Hi, Eugene Kirpichov ekirpic...@gmail.com writes: I'd like my program to print something like this is $program 1.0.4 git 45fea6b when invoked with --version, or at least just the 1.0.4 part. Here's some proof-of-concept code we use slightly modified in production here for over a year now

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Eugene Kirpichov
Hey, I created a small package: http://hackage.haskell.org/package/vcs-revision, repo http://github.com/jkff/vcs-revision It can be used like this: {-# LANGUAGE TemplateHaskell #-} import Distribution.VcsRevision.Git import Language.Haskell.TH.Syntax showMyGitVersion :: String

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Herbert Valerio Riedel
Eugene Kirpichov ekirpic...@gmail.com writes: It can be used like this: {-# LANGUAGE TemplateHaskell #-} import Distribution.VcsRevision.Git import Language.Haskell.TH.Syntax showMyGitVersion :: String showMyGitVersion = $(do v - qRunIO getRevision lift $ case v of

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Eugene Kirpichov
On Wed, Feb 22, 2012 at 2:57 PM, Herbert Valerio Riedel h...@gnu.org wrote: Eugene Kirpichov ekirpic...@gmail.com writes: It can be used like this: {-# LANGUAGE TemplateHaskell #-} import Distribution.VcsRevision.Git import Language.Haskell.TH.Syntax showMyGitVersion :: String

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-22 Thread Alberto G. Corona
Theoretically you only have to exec cabal install at the directory where setup.hs is located. It is not necessary neither cygwin neither mingw I guess ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] getAddrInfo: does not exist

2012-02-22 Thread Alexander Vasiliev
Hi. I use FreeBsd and get the following error during execution. mvz_server: getAddrInfo: does not exist (servname not supported for ai_socktype) System: FreeBsd 7.1; amd64. Haskell: ghc-7.0.3; network-2.3.0.5. The programm works well on Ubuntu and on Windows XP. The piece of code is: bindit ::

Re: [Haskell-cafe] how to add monad-stack to network-conduit

2012-02-22 Thread Michael Snoyman
On Tue, Feb 21, 2012 at 5:10 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello. I have got next problem: I want to have database connection pool in server based on network-conduit. So I wanted to be able to do runTCPServer options action   where     action src snk =    

Re: [Haskell-cafe] how to add monad-stack to network-conduit

2012-02-22 Thread Alexander V Vershilov
Wed, Feb 22, 2012 at 01:58:02PM +0200, Michael Snoyman wrote On Tue, Feb 21, 2012 at 5:10 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello. I have got next problem: I want to have database connection pool in server based on network-conduit. So I wanted to be able to

Re: [Haskell-cafe] Streaming to JuicyPixels

2012-02-22 Thread Vincent Berthoux
Hi, I can understand your performance problems, I bumped into them before the first release of Juicy Pixels and took a long time to get 'correct' performance out of the box, and the IDCT is not the only 'hot point', I got problems with intermediate data structure as well. Any list has proven a

Re: [Haskell-cafe] ANNOUNCE: HaskellDB 2.0: Scrap your SQL strings

2012-02-22 Thread Christopher Done
On 21 February 2012 11:51, Mats Rauhala mats.rauh...@gmail.com wrote: You mentioned that haskelldb was the first library where you weren't forced to break the abstraction. Do you have a solution to a situation where you might want to retrieve the last inserted id after an insert? That's a case

[Haskell-cafe] Functional programming podcast

2012-02-22 Thread Christopher Done
Show of hands, who would be interested in working on a podcast weekly or biweekly and what would you like to provide? Light banter is an acceptable answer. Some points that might be covered on such a podcast might be: * Latest FP conferences/hackathons/etc * Competitions * Interesting papers

Re: [Haskell-cafe] Functional programming podcast

2012-02-22 Thread Christopher Done
With permission I forward that Justin has offered to help cutting it up and would also be on it. On 22 February 2012 04:39, serialhex serial...@gmail.com wrote: So I'm not a very good haskell (or fp) programmer, though I wouldn't mind doing the audio splicing (which I've done amore than a

Re: [Haskell-cafe] Functional programming podcast

2012-02-22 Thread Thiago Negri
I will enjoy listening to a podcast like that. The community can provide interesting content (links, posts, papers, ...). Sort of a central feed to submit your suggestion to be discussed in subsequent podcasts. Thiago. 2012/2/22 Christopher Done chrisd...@googlemail.com: With permission I

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-22 Thread Stefan Monnier
I think, Apple has made their stance quite clear by releasing the command line dev tools: I'm not sure what you mean by that, but looking at the history of Apple devices, especially the recent history with iPad, iPhone, etc... it's pretty clear to me where this is headed: keep as tight a

Re: [Haskell-cafe] ANN: network-socket-options 0.1

2012-02-22 Thread Johan Tibell
Hi Conrad and Joey, On Tue, Feb 21, 2012 at 4:36 PM, Conrad Parker con...@metadecks.org wrote: awesome! I've prepared some patches for network to add this module and its tests, in this branch: https://github.com/kfish/network/tree/options I didn't modify any other modules, perhaps

Re: [Haskell-cafe] Data.Array.Accelerate initialization timings

2012-02-22 Thread Martin Dybdal
On 20 February 2012 16:39, Paul Sujkov psuj...@gmail.com wrote: Ah, it seems that I see now what's going wrong way. I'm not using the 'run' function from the CUDA backend, and so by default I guess the code is interpreted (the test backend used for semantics check). However, it's not perfectly

Re: [Haskell-cafe] Functional programming podcast

2012-02-22 Thread Tom Murphy
I'd listen. With good editing and good discussion, this could be a nice addition to my (bi)week. Tom (amindfv) On 2/22/12, Christopher Done chrisd...@googlemail.com wrote: Show of hands, who would be interested in working on a podcast weekly or biweekly and what would you like to provide?

Re: [Haskell-cafe] Functional programming podcast

2012-02-22 Thread Clint Moore
On Wed, Feb 22, 2012 at 5:50 AM, Christopher Done chrisd...@googlemail.com wrote: Show of hands, who would be interested in working on a podcast weekly or biweekly and what would you like to provide? Light banter is an acceptable answer. Some points that might be covered on such a podcast

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-22 Thread Austin Seipp
Manuel, Thanks for the references and follow up. I had seen Kennith's posts about the new command line tools for XCode, but didn't seen John Gruber's take! Much appreciated. On Tue, Feb 21, 2012 at 2:52 AM, Manuel M T Chakravarty c...@cse.unsw.edu.au wrote: Austin Seipp: On Sun, Feb 19, 2012

Re: [Haskell-cafe] ANN: network-socket-options 0.1

2012-02-22 Thread Joey Adams
On Wed, Feb 22, 2012 at 5:56 AM, L Corbijn aspergesoe...@gmail.com wrote: On Wed, Feb 22, 2012 at 5:58 AM, Joey Adams joeyadams3.14...@gmail.com wrote: I released network-socket-options 0.2, adding setSocketTimeouts and setHandleTimeouts.  I'll post an announcement in a separate thread once

Re: [Haskell-cafe] ANN: network-socket-options 0.1

2012-02-22 Thread Joey Adams
Thanks for the review! On Wed, Feb 22, 2012 at 11:15 AM, Johan Tibell johan.tib...@gmail.com wrote: The API looks fine except: HasSocket - I don't think we want to abstract over sockets here, as we don't do so in the rest of the module. I know it's a bit ugly, but not having it makes it hard

Re: [Haskell-cafe] getAddrInfo: does not exist

2012-02-22 Thread Brandon Allbery
On Wed, Feb 22, 2012 at 06:26, Alexander Vasiliev alexvasil...@gmail.comwrote: I use FreeBsd and get the following error during execution. mvz_server: getAddrInfo: does not exist (servname not supported for ai_socktype) (...) I googled that this error was solved in ghc 6.8. But i use ghc

Re: [Haskell-cafe] Streaming to JuicyPixels

2012-02-22 Thread Myles C. Maxfield
Let's put aside the issue of getting access to the pixels before the stream is complete. How would you feel if I implemented use of the STT monad transformer on top of Get in JuicyPixels, in order to get rid of the (remaining getBytes) call, and then expose the underlying Get interface to

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-22 Thread wren ng thornton
On 2/21/12 10:44 AM, wren ng thornton wrote: but domain products do not form domains! In order to get a product which does form a domain, we'd need to use the smash product[2] instead. Unfortunately we can't have our cake and eat it too Bah, I don't know why my wires were crossed yesterday.

Re: [Haskell-cafe] Streaming to JuicyPixels

2012-02-22 Thread Vincent Berthoux
Hi, Please go ahead, and github is the perfect medium for code sharing :) Regards Vincent Berthoux Le 22 février 2012 20:20, Myles C. Maxfield myles.maxfi...@gmail.com a écrit : Let's put aside the issue of getting access to the pixels before the stream is complete. How would you

[Haskell-cafe] Toronto Haskell Users Meetup

2012-02-22 Thread Christopher Olah
Hey All, There's going to be a Toronto Haskell Users Meetup at hacklab on March 7th starting at 7pm. Come by and meet your fellow Haskellers! http://thug1.eventbrite.com/ This will be the first one. I'm really looking forward to meeting other Haskellers in person! Haskell Users of Toronto,

Re: [Haskell-cafe] getAddrInfo: does not exist

2012-02-22 Thread Bryan O'Sullivan
On Wed, Feb 22, 2012 at 11:14 AM, Brandon Allbery allber...@gmail.comwrote: Note that FreeBSD handles IPv4 vs. IPv6 differently from Windows and Linux, and is probably not well tested with the GHC libraries. It is not impossible that there is a lingering bug. Yeah. I got a bug report from

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-22 Thread Manuel M T Chakravarty
Stefan Monnier: I think, Apple has made their stance quite clear by releasing the command line dev tools: I'm not sure what you mean by that, but looking at the history of Apple devices, especially the recent history with iPad, iPhone, etc... it's pretty clear to me where this is headed:

Re: [Haskell-cafe] Data.Array.Accelerate initialization timings

2012-02-22 Thread Manuel M T Chakravarty
Martin Dybdal: On 20 February 2012 16:39, Paul Sujkov psuj...@gmail.com wrote: Ah, it seems that I see now what's going wrong way. I'm not using the 'run' function from the CUDA backend, and so by default I guess the code is interpreted (the test backend used for semantics check). However,

[Haskell-cafe] Haskell Weekly News: Issue 216

2012-02-22 Thread Daniel Santa Cruz
Welcome to issue 216 of the HWN, a newsletter covering crowdsourced links for the Haskell community. This release covers the week of February 12 to 18, 2012. You can find the HTML version at: http://contemplatecode.blogspot.com/2012/02/haskell-weekly-news-issue-216.html Quotes of the Week *

Re: [Haskell-cafe] Functional programming podcast

2012-02-22 Thread Ryan Newton
+1 I'm always at a loss for good technical podcasts. The popular ones that come up (with a simple search) are such fluff! On Wed, Feb 22, 2012 at 12:00 PM, Clint Moore cl...@ivy.io wrote: On Wed, Feb 22, 2012 at 5:50 AM, Christopher Done chrisd...@googlemail.com wrote: Show of hands, who

Re: [Haskell-cafe] ANN: network-socket-options 0.1

2012-02-22 Thread Johan Tibell
Hi, On Wed, Feb 22, 2012 at 10:43 AM, Joey Adams joeyadams3.14...@gmail.com wrote: I know it's a bit ugly, but not having it makes it hard to work with unmanaged sockets (e.g. those buried under Handles).  If the functions take a managed Socket, you'd have to say something like:    

Re: [Haskell-cafe] Preventing leaked open file descriptors whencatching exceptions

2012-02-22 Thread Albert Y. C. Lai
I cannot reproduce pretty much any claim made in this thread. Unless PIO does not mean System.IO.Posix. I run mkfifo hello to create a named pipe. Then I run this program to keep trying to open for writing, non-blocking (without anyone at the read end initially): import System.Posix.IO

[Haskell-cafe] Where to get kansas-lava version 2.5

2012-02-22 Thread dilawar rajput
Hello Cafe, Greetings from Mumbai. Does anyone know where to get kansas-lava version 2.5? On their github repository (as well as on Hackage), they have not posteed version 2.5. However their kansas-lava-cores requires version kansas-lava 2.5. Currently I am working with kansas-lava 2.4 but I

Re: [Haskell-cafe] Where to get kansas-lava version 2.5

2012-02-22 Thread Thomas DuBuisson
Have you tried just bumping the version number of the kansas-lava repo head? Or asking Andy about it? At any rate, it looks like you're over-eager for the bleeding edge. KU hasn't even released 0.2.5 to hackage, as you noted, and users aren't typically expected to pull the latest from the source

Re: [Haskell-cafe] Where to get kansas-lava version 2.5

2012-02-22 Thread dilawar rajput
Thanks for the quick reply. Yup. I have search repo logs. I am not entirely sure what do you mean by bumping the version number. I think I should better query Andy about it. He is the man! On Thu, Feb 23, 2012 at 10:43 AM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: Have you tried

[Haskell-cafe] Clarifying a mis-understanding about regions (and iteratees)

2012-02-22 Thread oleg
I have just come across the reddit discussion about regions and iteratees. http://www.reddit.com/r/haskell/comments/orh4f/combining_regions_and_iteratees/ There is an unfortunate misunderstanding about regions which I'd like to correct. I'm posting in Cafe in hope that some of the participants