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

2010-08-10 Thread Ertugrul Soeylemez
"Edward Z. Yang" 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 =

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

2010-08-10 Thread Ketil Malde
Tom Hawkins 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 believe investm

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 M

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 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

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 e

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 "mobil

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

2010-08-10 Thread Ivan Lazar Miljenovic
Malcolm Wallace 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, > because different

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 'Zip.hs'

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 : eRelativeP

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 wrote: > Malcolm Wallace writes: > It's disproportionate.  95% of the job off

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

2010-08-10 Thread Ivan Lazar Miljenovic
Lennart Augustsson 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, etc.) or because no-

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 wrote: > Lennart Augustsson 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 fi

[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 be

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 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: http://www.haskell.org/onlinerep

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

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 u

[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 as

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 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 the technology

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 i

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

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 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. However,

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 com

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

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 wrote: From: Alex Stangl Subject: Re: [Haskell-cafe] Couple of questions about *let* within *do* To: "michael rice" Cc: "Tillmann Rendel" , haskell-cafe@haskell.org Date: Tuesday, August

[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 cours

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 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 improv

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 statemen

[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 wrote: > Hi all, > > I'm the author of zip-ar

[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 parti

Re: [Haskell-cafe] Unused import warnings.

2010-08-10 Thread Christopher Done
On 10 August 2010 22:22, Lyndon Maydwell 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 from it is

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 wrote: > On 10 August 2010 22:22, Lyndon Maydwell wrote: >> Hi Cafe. >> >> I have written some QuickCheck properties in my source and am using >> th

Re: [Haskell-cafe] Unused import warnings.

2010-08-10 Thread Christopher Done
On 10 August 2010 22:25, Lyndon Maydwell wrote: > On Wed, Aug 11, 2010 at 4:23 AM, Christopher Done > wrote: >> On 10 August 2010 22:22, Lyndon Maydwell wrote: >>> Hi Cafe. >>> >>> I have written some QuickCheck properties in my source and am using >>> these for testing, however, when I compile

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 pa

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 wrote: > On 10 August 2010 22:25, Lyndon Maydwell wrote: >> On Wed, Aug 11, 2010 at 4:23 AM, Christopher Done >> wrote: >>> On 10 August 2010 22:22, Lyndon Maydwell wrote: Hi Cafe.

[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.0>cabal 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 packa

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 Q

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 chan

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 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 you using a recent ve

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 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 of this func

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

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 '=' wi

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 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 not fa

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,

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 it

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 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 working again,

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 > And

[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 wrote: > > > On Mon, Aug 9, 2010 at 10:48 PM, Brandon Simmons > 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-

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 wrote: > > > > > > On Mon, Aug 9, 2010 at 10:48 PM, Brandon Simmons > > wrote: > >> > >> Greetings Haskellers! > >> > >> directory-tree is a module providing a di

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 wrote: > @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, correct? I wasn't able to