[Haskell-cafe] Escaping of string literals

2011-05-26 Thread Michael Snoyman
Hi all, I'm working on a program right now that will involve embedding some static files inside my Haskell program as bytestrings. I've done this in the past with file-embed[1]. In this case, I have a strange requirement: I need to be able to modify the embedded data after the compiler has run. In

[Haskell-cafe] Email spam from my account on May 26, 2011

2011-05-26 Thread Gregory Propf
I just discovered that some evil spammer has somehow gotten my contacts list and used it to send out a bunch of spam. This is just to notify you that if you get an email from me on May 26, 2011 (other than this one or one like it - the problem was more extensive than I first thought) it wasn'

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread michael rice
Are the tools of Control.Parallel comparable to OpenMP? Michael --- On Thu, 5/26/11, michael rice wrote: From: michael rice Subject: Re: [Haskell-cafe] Parallel compilation and execution? To: "David Virebayre" Cc: "Daniel Fischer" , haskell-cafe@haskell.org Date: Thursday, May 26, 2011, 9:32

[Haskell-cafe] (no subject)

2011-05-26 Thread Gregory Propf
As you my friend I invite you to visit my own site first!. http://prospero.ch/friends_links.php?uGIS=45ru4 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Jason Dagit
On Thu, May 26, 2011 at 1:43 PM, Gaius Hammond wrote: > > On 26 May 2011, at 21:34, Jason Dagit wrote: > >> On Thu, May 26, 2011 at 1:09 PM, Gaius Hammond wrote: >>> >>> >>> Over in OCaml-land, I have taken it upon myself to address this: >>> http://gaiustech.github.com/ociml/ >> >> Takusen alrea

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-26 Thread Jason Dagit
On Wed, May 25, 2011 at 4:02 PM, Ivan Lazar Miljenovic wrote: > On 26 May 2011 08:49, wren ng thornton wrote: >> On 5/25/11 1:03 PM, Bryan O'Sullivan wrote: >>> >>> On Wed, May 25, 2011 at 5:59 AM, Ivan Lazar Miljenovic< >>> ivan.miljeno...@gmail.com>  wrote: >>> Well, using the Char8 versio

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Gaius Hammond
On 26 May 2011, at 21:34, Jason Dagit wrote: On Thu, May 26, 2011 at 1:09 PM, Gaius Hammond wrote: Over in OCaml-land, I have taken it upon myself to address this: http://gaiustech.github.com/ociml/ Takusen already supports Oracle (and other rdbms) in a resource precise and good performa

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Jason Dagit
On Thu, May 26, 2011 at 1:09 PM, Gaius Hammond wrote: > > On 26 May 2011, at 19:22, Clint Moore wrote: > >> On Thu, May 26, 2011 at 10:57:42AM -0700, Jason Dagit wrote: >>> >>> Database connectivity is a weakspot still.  Haskell developers don't >>> seem to use databases nearly as often as Java de

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Stephen Tetley
Without support for at least extensible records and better GUI integration, you'd have a hard time convincing me to use Haskell for enterprise applications (and I use Haskell every day). It's not that Haskell isn't a fine language, it's just that doesn't have sufficient advantage on the state-of-p

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Gaius Hammond
On 26 May 2011, at 19:22, Clint Moore wrote: On Thu, May 26, 2011 at 10:57:42AM -0700, Jason Dagit wrote: Database connectivity is a weakspot still. Haskell developers don't seem to use databases nearly as often as Java developers. We have several libraries for this, takusen and hdbc come to

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Andrew Coppin
On 26/05/2011 07:56 PM, Andrew Coppin wrote: On 26/05/2011 10:59 AM, Jacek Generowicz wrote: Any comments on the relative efficiency of the above as compared to A == B in the context of data Foo = A | B | C | D | ... lots more ... ? (I imagine that a Sufficiently Smart Compiler could reduce

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Brandon Allbery
On Thu, May 26, 2011 at 14:56, Andrew Coppin wrote: > My understanding is that if you have a constructor with no fields, it gets > allocated as a compile-time constant. In other words, "C" is just a pointer > to a static data structure somewhere in the program binary, and (==) > effectively become

Re: [Haskell-cafe] Function application layout

2011-05-26 Thread Casey McCann
2011/5/26 Daniel Fischer > As far as I'm concerned, a left-associative version of ($) would sometimes > be nice (on the other hand, right-associativity of ($) is sometimes also > nice), but usually, I don't find parentheses too obnoxious. I have a whole set of function application/composition/lif

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Andrew Coppin
On 26/05/2011 10:59 AM, Jacek Generowicz wrote: Any comments on the relative efficiency of the above as compared to A == B in the context of data Foo = A | B | C | D | ... lots more ... ? (I imagine that a Sufficiently Smart Compiler could reduce (==) :: Person Person to just integer compari

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Michael Snoyman
On Thu, May 26, 2011 at 7:45 PM, Srinivasan Balram wrote: > folks: > I was advised to post this request here. This is about needs of daily-grind > enterprise development. > Enterprise developers need 3 categories of books in Haskell urgently: >  (i) Haskell (CookBooks / Recipes) >  (ii) Haskell En

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Clint Moore
On Thu, May 26, 2011 at 10:57:42AM -0700, Jason Dagit wrote: > Database connectivity is a weakspot still. Haskell developers don't > seem to use databases nearly as often as Java developers. We have > several libraries for this, takusen and hdbc come to mind. Real-World > Haskell documents using

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Jason Dagit
On Thu, May 26, 2011 at 11:17 AM, Clint Moore wrote: >  While it's not a solution (yet) for a book, would a section or special > section in the wiki be appropriate at least in the beginning?  Our small > company has been collecting cookbook-like recipies and best practices > for a while now but de

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Clint Moore
While it's not a solution (yet) for a book, would a section or special section in the wiki be appropriate at least in the beginning? Our small company has been collecting cookbook-like recipies and best practices for a while now but definitely not anything close to as polished or collated as a b

Re: [Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Jason Dagit
On Thu, May 26, 2011 at 9:45 AM, Srinivasan Balram wrote: > folks: > I was advised to post this request here. This is about needs of daily-grind > enterprise development. > Enterprise developers need 3 categories of books in Haskell urgently: >  (i) Haskell (CookBooks / Recipes) The HaskellWiki h

[Haskell-cafe] Enterprise Haskell -- help

2011-05-26 Thread Srinivasan Balram
folks: I was advised to post this request here. This is about needs of daily-grind enterprise development. Enterprise developers need 3 categories of books in Haskell urgently: (i) Haskell (CookBooks / Recipes) (ii) Haskell Enterprise Development i.e. how to connect commercial RDBMS and use

Re: [Haskell-cafe] Function application layout

2011-05-26 Thread Daniel Fischer
On Thursday 26 May 2011 17:22:10, Jonas Almström Duregård wrote: > Unfortunately it does not play nice with $. Yes. > Also I'm not sure this can be used for defining trees or nested function > application since a nesting of the operator inevitably require > parenthesis. It can't be nested, like

Re: [Haskell-cafe] Function application layout

2011-05-26 Thread Jonas Almström Duregård
That's a useful operator! Unfortunately it does not play nice with $. Of less importance: some syntactic constructs can not appear in the arguments without parenthesis, let bindings for instance (although lambda abstraction works parenthesis-free). Also I'm not sure this can be used for defining t

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Simon Meier
2011/5/26 Jacek Generowicz : > > On 2011 May 26, at 11:16, Christopher Done wrote: > >> On 26 May 2011 10:45, Jacek Generowicz wrote: >>> >>> What is the Haskell approach to efficient comparison and lookup of >>> objects >>> by their identity? >> >> Often you just provide your own and implement Eq

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Gregory Collins
Based on the description it looks like you could be looking for: http://hackage.haskell.org/package/simple-atom G On Thu, May 26, 2011 at 10:45 AM, Jacek Generowicz wrote: > [ TLDR: How do you do Lisp symbols in Haskell? ] > > > What is the Haskell approach to efficient comparison and looku

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread michael rice
Fair question. I copied the parallel version from: http://www.haskell.org/ghc/docs/6.6/html/users_guide/lang-parallel.html but pulled the non-parallel version from a text. Michael --- On Thu, 5/26/11, David Virebayre wrote: From: David Virebayre Subject: Re: [Haskell-cafe] Parallel compilation

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread Brandon Moore
>From: michael rice, Thursday, May 26, 2011 >Subject: Re: [Haskell-cafe] Parallel compilation and execution? > >Thank, Daniel > >Multiple threads are in evidence in my system monitor, but I wonder why I'm >getting two different answers, one twice the other. The first is the parallel >solution and

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread David Virebayre
2011/5/26 michael rice > Thank, Daniel > > Multiple threads are in evidence in my system monitor, but I wonder why I'm > getting two different answers, one twice the other. The first is the > parallel solution and the second is the non. > Why do you add n1+n2+1 in the parallel program, but only

Re: [Haskell-cafe] Function application layout

2011-05-26 Thread Daniel Fischer
On Thursday 26 May 2011 14:35:41, Neil Brown wrote: > foo is the function we want to apply, and eg shows how to apply it in > do-notation with an argument on each line. I couldn't manage to remove > the r$ at the beginning of each line, which rather ruins the whole > scheme :-( On the plus sid

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread michael rice
Thank, Daniel Multiple threads are in evidence in my system monitor, but I wonder why I'm getting two different answers, one twice the other. The first is the parallel solution and the second is the non. Michael === {-import Control.Parallel nfib :: Int -> Intnfib n | n <= 1 = 1       | o

Re: [Haskell-cafe] Function application layout

2011-05-26 Thread Neil Brown
On 25/05/11 10:00, Jonas Almström Duregård wrote: As an equivalent to: f (x a) (y b) (z c) Of course my intention is that the new keyword should initiate layout syntax so we can write this: f x a y b z c Here's a (tongue-in-cheek) trick that allows for layout close to what you wan

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread Daniel Fischer
On Thursday 26 May 2011 13:24:09, michael rice wrote: > How do I compile and run this parallel program? > Michael > === > import Control.Parallel > nfib :: Int -> Int > nfib n | n <= 1 = 1 >| otherwise = par n1 (seq n2 (n1 + n2 + 1)) The 'seq' here should be

[Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread michael rice
How do I compile and run this parallel program? Michael === import Control.Parallel nfib :: Int -> Intnfib n | n <= 1 = 1       | otherwise = par n1 (seq n2 (n1 + n2 + 1))                     where n1 = nfib (n-1)                           n2 = nfib (n-2) {-nfib :: Int ->

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Jacek Generowicz
On 2011 May 26, at 11:59, Jacek Generowicz wrote: (I imagine that a Sufficiently Smart Compiler could reduce (==) :: Person Person to just integer comparison.) Sorry, I meant (==) :: Person -> Person -> Bool in the above. ___ Haskell-Cafe maili

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Jacek Generowicz
On 2011 May 26, at 11:59, Brandon Allbery wrote: On Thu, May 26, 2011 at 05:41, Jacek Generowicz > wrote: On 2011 May 26, at 11:12, Brandon Allbery wrote: (Think gensym. Hm, except last time I did anything serious with Lisp, it was Maclisp... does gensym even still exist, or did CL do some

Re: [Haskell-cafe] Strange Type Error

2011-05-26 Thread Brandon Allbery
On Thu, May 26, 2011 at 06:10, Christopher Done wrote: > This kicks everyone in the butt at least once. It would be good if GHC > could point it out, as mine (6.12.3) just complains about no instance. > Maybe GHC7 does point it out. It's a waste of people's time otherwise. I think the Haskell sta

Re: [Haskell-cafe] Strange Type Error

2011-05-26 Thread Brandon Allbery
On Thu, May 26, 2011 at 06:01, jean-christophe mincke wrote: > f1 x =  convertToInt x > f2 = \x -> convertToInt x Absent useful things like error messages, I'll assume that you tripped over the monomorphism restriction. That is, when you have a name that doesn't take a direct parameter, there ar

Re: [Haskell-cafe] Strange Type Error

2011-05-26 Thread Christopher Done
The problem is the monomorphism restriction: http://www.haskell.org/haskellwiki/Monomorphism_restriction http://www.haskell.org/ghc/docs/7.0.2/html/users_guide/monomorphism.html http://stackoverflow.com/questions/tagged/monomorphism-restriction http://www.cs.auckland.ac.nz/references/haskell/haske

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs & graphics

2011-05-26 Thread John Lato
fltk definitely has some good points, but I've always found it hideously ugly. Of course the default gtk on osx is ugly too, but some of the available themes are nice. However, getting gtk with OpenGL on osx was fairly easy. Everything worked out of the box except gtkglext (Haskell package). I'

[Haskell-cafe] Strange Type Error

2011-05-26 Thread jean-christophe mincke
Hello, Could anyone help me understand what is wrong with the definition of f2 in the code below? class C a b where convert :: a -> b convertToInt :: (C a Int) => a -> Int convertToInt x = convert x f1 x = convertToInt x f2 = \x -> convertToInt x f3 :: (C a Int) => a -> Int f3 = \x -> c

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Brandon Allbery
On Thu, May 26, 2011 at 05:41, Jacek Generowicz wrote: > On 2011 May 26, at 11:12, Brandon Allbery wrote: > >> (Think gensym. Hm, except last time I did anything serious with Lisp, it >> was Maclisp... does gensym even still exist, or did CL do something >> inscrutable with it?) > > > But gensym

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Jacek Generowicz
On 2011 May 26, at 11:16, Christopher Done wrote: On 26 May 2011 10:45, Jacek Generowicz wrote: What is the Haskell approach to efficient comparison and lookup of objects by their identity? Often you just provide your own and implement Eq. I should be able to run the program on data tha

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Jacek Generowicz
On 2011 May 26, at 11:12, Brandon Allbery wrote: On Thu, May 26, 2011 at 04:45, Jacek Generowicz > wrote: What is the Haskell approach to efficient comparison and lookup of objects by their identity? ghc uses Data.Unique to generate unique internal identifiers to associate with things. A

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Christopher Done
On 26 May 2011 10:45, Jacek Generowicz wrote: > What is the Haskell approach to efficient comparison and lookup of objects > by their identity? Often you just provide your own and implement Eq. > I should be able to run the program on data that becomes available at run > time. Typically you def

Re: [Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Brandon Allbery
On Thu, May 26, 2011 at 04:45, Jacek Generowicz wrote: > What is the Haskell approach to efficient comparison and lookup of objects > by their identity? > ghc uses Data.Unique to generate unique internal identifiers to associate with things. (Think gensym. Hm, except last time I did anything se

[Haskell-cafe] Efficient object identity (aka symbols as data)

2011-05-26 Thread Jacek Generowicz
[ TLDR: How do you do Lisp symbols in Haskell? ] What is the Haskell approach to efficient comparison and lookup of objects by their identity? Maybe a toy example would help to explain what I mean. Imagine that I want to use Haskell to maximize happiness in a situation where a bunch of pe