Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Max Cantor
Remember that Banks/Financial Firms/Investment Banks were among the first big uses of punch card readers, mainframes, cobol, C, C++ (and OOP), VBA, Java.. I'm not saying if I like any of those languages (my presence on this list should give a clue how I feel) but investment banks picking up FP

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Casey Hawthorne
Of course Banks/Financial Firms/Investment Banks want software that is correct, secure, and logs transactions. Aspects are great for cross-cutting concerns like security and logging; as in AspectJ. For correctness, functional programming has that. With monads its easy to add logging and

[Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Ertugrul Soeylemez
Edward Z. Yang ezy...@mit.edu wrote: Excerpts from Luke Palmer's message of Tue Aug 10 01:04:04 -0400 2010: Except, of course, you want the signature evalCont :: Cont r a - a Which is not possible. But I am not sure where all this discussion is coming from, Maybe and (r -) cannot

Re: [Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Edward Z. Yang
Excerpts from Ertugrul Soeylemez's message of Tue Aug 10 02:31:14 -0400 2010: There is no evalCont, there is runCont: runCont :: (a - r) - Cont r a - r Note that Cont/ContT computations result in a value of type 'r': newtype Cont r a = Cont ((a - r) - r) Yes, but if you pass in 'id'

[Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Ertugrul Soeylemez
Edward Z. Yang ezy...@mit.edu wrote: Excerpts from Ertugrul Soeylemez's message of Tue Aug 10 02:31:14 -0400 2010: There is no evalCont, there is runCont: runCont :: (a - r) - Cont r a - r Note that Cont/ContT computations result in a value of type 'r': newtype Cont r a = Cont

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Ketil Malde
Tom Hawkins tomahawk...@gmail.com writes: Second, I would like to know what exactly is bad about a Haskell job in investment banking as a lot of good programmers work in this industry. It's disproportionate. 95% of the job offerings in functional programming are with investment firms. I

RE: [Haskell-cafe] Is there any experience using Software Transactional Memory in substantial applications?

2010-08-10 Thread Simon Peyton-Jones
| Recently we discussed Haskell and especially types in Russian part of | LiveJournal and of course we talk about STM. | | My opponent gave me that link: | http://logicaloptimizer.blogspot.com/2010/06/so-microsofts-experiments-with- | software.html | | It says that performance with STM in

Re: [Haskell-cafe] Can we come out of a monad?

2010-08-10 Thread John Lato
On Tue, Aug 10, 2010 at 6:48 AM, Edward Z. Yang ezy...@mit.edu wrote: Excerpts from Luke Palmer's message of Tue Aug 10 01:04:04 -0400 2010: Except, of course, you want the signature   evalCont :: Cont r a - a Which is not possible.  But I am not sure where all this discussion is coming

Re: [Haskell-cafe] iPhone/Android and Haskell [Was: Embedded funcional programming?]

2010-08-10 Thread Karel Gardas
On 08/08/10 01:44, Don Stewart wrote: Only problem is rewriting the GHC runtime in Java... :-) Perhaps I don't understand the problem domain correctly, but IMHO this project was already once done in LambdaVM: http://wiki.brianweb.net/LambdaVM/LambdaVM. Karel

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Malcolm Wallace
It's disproportionate. 95% of the job offerings in functional programming are with investment firms. I'm not sure that is really true. You might see more adverts for financial jobs, but often those jobs may be advertised multiple times, because different headhunters see an opportunity to

Re: [Haskell-cafe] iPhone/Android and Haskell [Was: Embedded funcional programming?]

2010-08-10 Thread Karel Gardas
On 08/08/10 03:08, Mathew de Detrich wrote: Well the other issue is of course that Android being available on a wide variety of phones, not all of which run ARM (the phone I am about to get for example has a custom built CPU), although I guess one could use a generic ASM branch for mobile

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Ivan Lazar Miljenovic
Malcolm Wallace malcolm.wall...@me.com writes: It's disproportionate. 95% of the job offerings in functional programming are with investment firms. I'm not sure that is really true. You might see more adverts for financial jobs, but often those jobs may be advertised multiple times,

Re: [Haskell-cafe] zip-archive performance/memmory usage

2010-08-10 Thread David Powell
I was interested to see if I could determine what was happening with this. After some playing around, I noticed the code was running significantly faster if I *didn't* compile it, but ran it with 'runghc' instead (running under ghci was also fast). Here are the running times I found. The

Re: [Haskell-cafe] zip-archive performance/memmory usage

2010-08-10 Thread Neil Brown
On 10/08/10 00:29, Pieter Laeremans wrote: Hello, I'm trying some haskell scripting. I'm writing a script to print some information from a zip archive. The zip-archive library does look nice but the performance of zip-archive/lazy bytestring doesn't seem to scale. Executing :

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Lennart Augustsson
Rather than high turnover it indicates (in my experience) that it's difficult to fill positions in finance. That's one reason they are advertised repeatedly. On Tue, Aug 10, 2010 at 12:27 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Malcolm Wallace malcolm.wall...@me.com writes:

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Ivan Lazar Miljenovic
Lennart Augustsson lenn...@augustsson.net writes: Rather than high turnover it indicates (in my experience) that it's difficult to fill positions in finance. That's one reason they are advertised repeatedly. Because you can't find people that are good enough (in terms of required skill sets,

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Lennart Augustsson
The former. On Tue, Aug 10, 2010 at 2:59 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Lennart Augustsson lenn...@augustsson.net writes: Rather than high turnover it indicates (in my experience) that it's difficult to fill positions in finance. That's one reason they are

[Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread michael rice
From: Learn You a Haskell === Remember let bindings? If you don't, refresh your memory on them by reading this section. They have to be in the form of let bindings in expression, where bindings are names to be given to expressions and expression is the expression that is to

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Felipe Lessa
On Tue, Aug 10, 2010 at 1:40 PM, michael rice nowg...@yahoo.com wrote: 1) Is there an implicit *in* before the last line above? The (let ... in ...) construct is an expression, while the (let ...) inside 'do' is a statement. The (do ...) itself is an expression. See the report:

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Job Vranish
Yes, and yes :) For example: import Data.Char main = do let prompt s = do putStrLn s getLine firstName - prompt What's your first name? lastName - prompt What's your last name? let bigFirstName = map toUpper firstName bigLastName = map toUpper lastName putStrLn $ hey

Re: [Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Edward Z. Yang
Excerpts from Ertugrul Soeylemez's message of Tue Aug 10 03:40:02 -0400 2010: Then you can only run evalCont, if r = a, which makes that function quite pointless: evalCont :: Cont r r - r evalCont = runCont id Ah, yes, that was what I was imagining. I don't think the function is

[Haskell-cafe] Re: zip-archive performance/memmory usage

2010-08-10 Thread John MacFarlane
Hi all, I'm the author of zip-archive. I wrote it for a fairly special purpose -- I wanted to create and read ODT files in pandoc -- and I know it could be improved. The main problem is that the parsing algorithm is kind of stupid; it just reads the whole archive in sequence, storing the files

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread michael rice
OK, then there's also an implicit *in* after the *let* in this code. Must the implicit (or explicit) *in* actually use the calculated value(s)? And, the monad can continue on after the *let* (with or without the *in*) as below, i.e., the *let* needn't be the last statement in the *do*? main =

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Henning Thielemann
about functional programming jobs in investment banking ... Ketil Malde schrieb: Tom Hawkins tomahawk...@gmail.com writes: (Yes, I realize that's were the money is [...]) Exactly. I don't think this is bad: having talented people recruited to work on functional programming will improve

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Tillmann Rendel
michael rice wrote: OK, then there's also an implicit *in* after the *let* in this code. If you want to understand let statements in terms of let ... in ... expressions, you can do the following transformation: do s1 s2 let x1 = e1 x2 = e2 s3 s4 becomes do

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Daniel Fischer
On Tuesday 10 August 2010 19:12:57, michael rice wrote: OK, then there's also an implicit *in* after the *let* in this code. Yes. do let x = foo bar baz is desugared to let x = foo in (bar baz) Must the implicit (or explicit) *in* actually use the calculated value(s)? No, and if

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Bill Atkins
The let's aren't really statements, they're just named expressions and are still subject to lazy evaluation. In: let x = putStrLn Name getLine putStrLn Welcome x The program will print: Welcome Name? and then prompt for input, even though the let comes first. And if you never ran the

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Felipe Lessa
On Tue, Aug 10, 2010 at 2:40 PM, Bill Atkins batkin...@gmail.com wrote: They're not really statements, they're just named expressions and are still subject to lazy evaluation. In:  let x = putStrLn Name getLine  putStrLn Welcome  x Yes, 'putStrLn name getLine' is an expression.

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread michael rice
Hi all, Thanks. I think I've got it. It nice to have come far enough with this to be thinking about how the pieces fit together. One more question: Since   do s1 s2 let x1 = e1 x2 = e2 s3 s4 becomes   do s1 s2 let x1 = e1 x2 = e2 in do s3   

[Haskell-cafe] QuickCheck and Pairing Heaps

2010-08-10 Thread Matias Eyzaguirre
Hi, I'm trying to figure out QuickCheck and how to generate arbitrary test data form complex data structures; I thought an interesting experiment would be Pairing Heaps. A pairing heap is essentially just a tree whose nodes obey the heap property (for all nodes A in a pairing whose nodes can be

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Alex Stangl
On Tue, Aug 10, 2010 at 11:01:28AM -0700, michael rice wrote: Hi all, Then, do s1 s2 let x1 = e1 x2 = e2 s3 s4 let x3 = e3 x4 = e4 s5 s6 becomes do s1 s2 let x1 = e1 x2 = e2 in do s3

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread michael rice
So all the Xs would be in scope at s6. Important point. Thanks, Michael --- On Tue, 8/10/10, Alex Stangl a...@stangl.us wrote: From: Alex Stangl a...@stangl.us Subject: Re: [Haskell-cafe] Couple of questions about *let* within *do* To: michael rice nowg...@yahoo.com Cc: Tillmann Rendel

[Haskell-cafe] Re: QuickCheck and Pairing Heaps

2010-08-10 Thread Johannes Waldmann
Hi, I'm trying to figure out QuickCheck and how to generate arbitrary test data form complex data structures; sometimes the following workaround is enough: if you have a function that makes a tree (heap) from a list, then generate an arbitrary list, and make the tree from that. of course

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread wren ng thornton
Henning Thielemann wrote: about functional programming jobs in investment banking ... Ketil Malde schrieb: Tom Hawkins tomahawk...@gmail.com writes: (Yes, I realize that's were the money is [...]) Exactly. I don't think this is bad: having talented people recruited to work on functional

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread wren ng thornton
michael rice wrote: OK, then there's also an implicit *in* after the *let* in this code. Must the implicit (or explicit) *in* actually use the calculated value(s)? And, the monad can continue on after the *let* (with or without the *in*) as below, i.e., the *let* needn't be the last statement

[Haskell-cafe] Re: zip-archive performance/memmory usage

2010-08-10 Thread Pieter Laeremans
Thanks for your comments John. I appreciate your work. I think pandoc is fantastic! I'm interested to solve this problem, but time is also an issue. I'll try to toy around with it. Thanks, Pieter On Tue, Aug 10, 2010 at 7:06 PM, John MacFarlane j...@berkeley.edu wrote: Hi all, I'm the

[Haskell-cafe] Unused import warnings.

2010-08-10 Thread Lyndon Maydwell
Hi Cafe. I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports: Warning: Module `Test.QuickCheck' is imported, but nothing from it is used Is there a way to suppress these warnings for a

Re: [Haskell-cafe] Unused import warnings.

2010-08-10 Thread Christopher Done
On 10 August 2010 22:22, Lyndon Maydwell maydw...@gmail.com wrote: Hi Cafe. I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports: Warning: Module `Test.QuickCheck' is imported, but nothing

Re: [Haskell-cafe] Unused import warnings.

2010-08-10 Thread Lyndon Maydwell
I'm using qualified properties with (import Test.QuickCheck ((==))) so that may not be possible. On Wed, Aug 11, 2010 at 4:23 AM, Christopher Done chrisd...@googlemail.com wrote: On 10 August 2010 22:22, Lyndon Maydwell maydw...@gmail.com wrote: Hi Cafe. I have written some QuickCheck

Re: [Haskell-cafe] Unused import warnings.

2010-08-10 Thread Christopher Done
On 10 August 2010 22:25, Lyndon Maydwell maydw...@gmail.com wrote: On Wed, Aug 11, 2010 at 4:23 AM, Christopher Done chrisd...@googlemail.com wrote: On 10 August 2010 22:22, Lyndon Maydwell maydw...@gmail.com wrote: Hi Cafe. I have written some QuickCheck properties in my source and am using

Re: [Haskell-cafe] [ANNOUNCE] (and request for review): directory-tree v0.9.0

2010-08-10 Thread Jason Dagit
On Mon, Aug 9, 2010 at 10:48 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: Greetings Haskellers! directory-tree is a module providing a directory-tree-like datatype along with Foldable and Traversable instances, along with a simple, high-level IO interface. You can see the package

Re: [Haskell-cafe] Unused import warnings.

2010-08-10 Thread Lyndon Maydwell
Is there a way to just ignore the warnings for QuickCheck? On Wed, Aug 11, 2010 at 4:32 AM, Christopher Done chrisd...@googlemail.com wrote: On 10 August 2010 22:25, Lyndon Maydwell maydw...@gmail.com wrote: On Wed, Aug 11, 2010 at 4:23 AM, Christopher Done chrisd...@googlemail.com wrote: On

[Haskell-cafe] cabal haddock doesn't work for me on win7

2010-08-10 Thread Ryan Ingram
I'm not sure what's going on, here's the error I get: C:\haskell\ListZipper-1.1.1.0cabal haddock Running Haddock for ListZipper-1.1.1.0... Preprocessing library ListZipper-1.1.1.0... Warning: The documentation for the following packages are not installed. No links will be generated to these

Re: [Haskell-cafe] Unused import warnings.

2010-08-10 Thread Martijn van Steenbergen
Are you saying that GHC complains about an unused import that is in fact used? Perhaps you've run into this bug: http://hackage.haskell.org/trac/ghc/ticket/1148 Are you using a recent version of GHC? Groetjes, Martijn. On 8/10/10 22:22, Lyndon Maydwell wrote: Hi Cafe. I have written some

Re: [Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Martijn van Steenbergen
On 8/2/10 7:09, Ertugrul Soeylemez wrote: Given the definition of a Haskell function, Haskell is a pure language. The notion of a function in other languages is not: int randomNumber(); The result of this function is an integer. You can't replace the function call by its result without

Re: [Haskell-cafe] Unused import warnings.

2010-08-10 Thread Lyndon Maydwell
Fantastic. It was the bug mentioned. On Wed, Aug 11, 2010 at 5:00 AM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Are you saying that GHC complains about an unused import that is in fact used? Perhaps you've run into this bug: http://hackage.haskell.org/trac/ghc/ticket/1148 Are

Re: [Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Felipe Lessa
On Tue, Aug 10, 2010 at 6:21 PM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: On 8/2/10 7:09, Ertugrul Soeylemez wrote: Given the definition of a Haskell function, Haskell is a pure language. The notion of a function in other languages is not:   int randomNumber(); The result

Re: [Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Steve Schafer
On Tue, 10 Aug 2010 18:27:49 -0300, you wrote: Nope. For example, suppose we have: int randomNumber(int min, int max); Equivalentely: randomNumber :: Int - Int - IO Int In Haskell if we say (+) $ randomNumber 10 15 * randomNumber 10 15 That's the same as let x = randomNumber 10 15

Re: [Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Martijn van Steenbergen
On 8/10/10 23:27, Felipe Lessa wrote: If we had in C: return (randomNumber(10, 15) + randomNumber(10, 15)) That would not be the same as: int x = randomNumber(10, 15) return (x + x) That's not fair. You're comparing C's '=' with Haskell's '='. But you should be comparing C's '='

Re: [Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Felipe Lessa
On Tue, Aug 10, 2010 at 6:36 PM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: On 8/10/10 23:27, Felipe Lessa wrote: If we had in C:   return (randomNumber(10, 15) + randomNumber(10, 15)) That would not be the same as:   int x = randomNumber(10, 15)   return (x + x) That's

Re: [Haskell-cafe] Re: Can we come out of a monad?

2010-08-10 Thread Martijn van Steenbergen
On 8/10/10 23:53, Felipe Lessa wrote: and the result is IO Int. When we replace the function call by its result, I think it is fair to replace the C function call by an int and the Haskell function call by an IO Int, because that is what those functions return. Fair enough. :-) Also, a

Re: [Haskell-cafe] iPhone/Android and Haskell [Was: Embedded funcional programming?]

2010-08-10 Thread Mathew de Detrich
I just did some further talking with Liam, and it appears that the NDK really just produces an ARM binary which ends up getting linked into the Dalvik VM files (it isn't platform independant as I thought) which means that using LLVM to produce an ARM ASM output is a fine choice. By the sounds of

Re: [Haskell-cafe] iPhone/Android and Haskell [Was: Embedded funcional programming?]

2010-08-10 Thread Rogan Creswick
On Tue, Aug 10, 2010 at 4:23 PM, Mathew de Detrich dete...@gmail.com wrote: There still however leaves the problem with what to do with Java, because a proper Android app (not a linux app compiled for ARM) needs to link with Java to interface with Android I'm interested in getting jvm-bridge

Re: [Haskell-cafe] iPhone/Android and Haskell [Was: Embedded funcional programming?]

2010-08-10 Thread John Meacham
On Sun, Aug 08, 2010 at 01:08:30AM +, Mathew de Detrich wrote: In my opinion the most reliable approach would actually to produce the C that wraps around NDK (for any code that could be possible) which would obviously interface with the Java libraries. Probably the biggest bane of Android

[Haskell-cafe] StablePtr overhead?

2010-08-10 Thread Gregory Collins
Hi all, Can anyone explain what the overhead of using StablePtrs is? Specifically I am interested in knowing the time/space complexity of the various Foreign.StablePtr operations and how many memory indirections are involved when using deRefStablePtr. G -- Gregory Collins

Re: [Haskell-cafe] StablePtr overhead?

2010-08-10 Thread Don Stewart
greg: Hi all, Can anyone explain what the overhead of using StablePtrs is? Specifically I am interested in knowing the time/space complexity of the various Foreign.StablePtr operations and how many memory indirections are involved when using deRefStablePtr. There's a hashtable in the

Re: [Haskell-cafe] [ANNOUNCE] (and request for review): directory-tree v0.9.0

2010-08-10 Thread Brandon Simmons
On Tue, Aug 10, 2010 at 4:34 PM, Jason Dagit da...@codersbase.com wrote: On Mon, Aug 9, 2010 at 10:48 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: Greetings Haskellers! directory-tree is a module providing a directory-tree-like datatype along with Foldable and Traversable

Re: [Haskell-cafe] [ANNOUNCE] (and request for review): directory-tree v0.9.0

2010-08-10 Thread Jason Dagit
On Tue, Aug 10, 2010 at 5:54 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: On Tue, Aug 10, 2010 at 4:34 PM, Jason Dagit da...@codersbase.com wrote: On Mon, Aug 9, 2010 at 10:48 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: Greetings Haskellers! directory-tree

Re: [Haskell-cafe] Re: [web-devel] statically compiled css

2010-08-10 Thread Michael Snoyman
On Mon, Aug 9, 2010 at 4:14 PM, Liam O'Connor lia...@cse.unsw.edu.auwrote: @Michael: Have you seen the JSMacro package on hackage? I think it might be a better fit as it adds some nice syntactic goodies to JS in addition to variable interpolation. I assume you're referring to JMacro,