[Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Matthew
I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or whether it's better to use pattern matching. I've got two functions which take an input and return Maybe SomeType. If either returns Nothing, I also want

[Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Vasili I. Galchin
Hello Haskell Group, I work in mainstream software industry. I am going to make an assumption except for Jane Street Capital all/most Wall Street software is written in an imperative language. Assuming this why is Wall Street not awaken to the dangers. As I write, Knight

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Benjamin Edwards
The do notation in this instance yields a nice advantage: if you want to switch to a different monad to encapsulate failure you will meely need to swap out the type signature and your function will need no further work. On Aug 4, 2012 7:35 AM, Matthew wonderzom...@gmail.com wrote: I'm a somewhat

Re: [Haskell-cafe] cabal-dev + haskell mode (vim)

2012-08-04 Thread Benjamin Edwards
Of course! I will have a play this weekend. Thanks for the advice. On Aug 3, 2012 10:45 PM, Nathan Howell nathan.d.how...@gmail.com wrote: On Fri, Aug 3, 2012 at 2:35 PM, Benjamin Edwards edwards.b...@gmail.com wrote: I am struggling to get ctags and / or haskell mode to work with cabal-dev.

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Johan Holmquist
Also if you don't need foo and bar you can write: callFoo callBar return baz //Johan On Aug 4, 2012 8:36 AM, Matthew wonderzom...@gmail.com wrote: I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Ketil Malde
Vasili I. Galchin vigalc...@gmail.com writes: I am going to make an assumption except for Jane Street Capital all/most Wall Street software is written in an imperative language. Tsuru Captial and Standard Chartered are also known to hire functional programmers. Assuming this

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Alexander Solla
On Fri, Aug 3, 2012 at 11:34 PM, Matthew wonderzom...@gmail.com wrote: I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or whether it's better to use pattern matching. I've got two functions which take

[Haskell-cafe] Sorting efficiency

2012-08-04 Thread David Feuer
I'm writing a toy program (for a SPOJ problem--see https://www.spoj.pl/problems/ABCDEF/ ) and the profiler says my performance problem is that I'm spending too much time sorting. I'm using Data.List.sort on [Int32] (it's a 32-bit architecture). Others, using other languages, have managed to solve

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Jay Sulzberger
On Sat, 4 Aug 2012, Vasili I. Galchin vigalc...@gmail.com wrote: Hello Haskell Group, I work in mainstream software industry. I am going to make an assumption except for Jane Street Capital all/most Wall Street software is written in an imperative language. Assuming this why

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Jake McArthur
I feel like this thread is kind of surreal. Knight Capital's mistake was to use imperative programming styles? An entire industry is suffering because they haven't universally applied category theory to software engineering and live systems? Am I just a victim of a small troll/joke? - Jake On

Re: [Haskell-cafe] [Haskell] Spam on the Haskell wiki

2012-08-04 Thread Gwern Branwen
On Fri, Aug 3, 2012 at 10:34 PM, damodar kulkarni kdamodar2...@gmail.com wrote: So, another doubt, if detecting spam is trivial, then why not just send the detected spam to trash directly without any human inspection? This may mean some trouble for the posters due to false positives; but the

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Jay Sulzberger
On Sat, 4 Aug 2012, Jake McArthur jake.mcart...@gmail.com wrote: I feel like this thread is kind of surreal. Knight Capital's mistake was to use imperative programming styles? An entire industry is suffering because they haven't universally applied category theory to software engineering and

Re: [Haskell-cafe] Sorting efficiency

2012-08-04 Thread Clark Gaebel
It's generally not advisable to use Data.List for performance-sensitive parts of an application. Try using Data.Vector instead: http://hackage.haskell.org/package/vector On Sat, Aug 4, 2012 at 11:23 AM, David Feuer david.fe...@gmail.com wrote: I'm writing a toy program (for a SPOJ problem--see

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Clark Gaebel
Yes. On Sat, Aug 4, 2012 at 1:47 PM, Jay Sulzberger j...@panix.com wrote: On Sat, 4 Aug 2012, Jake McArthur jake.mcart...@gmail.com wrote: I feel like this thread is kind of surreal. Knight Capital's mistake was to use imperative programming styles? An entire industry is suffering

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Jay Sulzberger
On Sat, 4 Aug 2012, Clark Gaebel cgae...@uwaterloo.ca wrote: Yes. Thank you! Further, if you want: Let us have two types s and t. Let _|_^s be the_|_ for type s, and let _|_^t be the _|_ for type t. For which famous equivalences of the Haskell System are these two _|_ objects

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Clark Gaebel
As far as I know, you can't check equivalence of _|_. Since Haskell uses _|_ to represent a nonterminating computation, this would be synonymouswith solving the halting problem. On Sat, Aug 4, 2012 at 2:04 PM, Jay Sulzberger j...@panix.com wrote: On Sat, 4 Aug 2012, Clark Gaebel

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Jay Sulzberger
On Sat, 4 Aug 2012, Clark Gaebel cgae...@uwaterloo.ca wrote: As far as I know, you can't check equivalence of _|_. Since Haskell uses _|_ to represent a nonterminating computation, this would be synonymouswith solving the halting problem. Ah, thanks. I will attempt to think about this.

[Haskell-cafe] Deprecating packages on Hackage

2012-08-04 Thread Andrey Chudnov
Hello. What are the best practices in deprecating packages on Hackage? I've seen packages marked DEPRECATED in the synopsis field on Hackage, and one could add GHC deprecated pragmas for every module, but is that the best one can do? Thank you in advance, Andrey Chudnov

Re: [Haskell-cafe] Deprecating packages on Hackage

2012-08-04 Thread Felipe Almeida Lessa
On Sat, Aug 4, 2012 at 3:30 PM, Andrey Chudnov achud...@gmail.com wrote: Hello. What are the best practices in deprecating packages on Hackage? I've seen packages marked DEPRECATED in the synopsis field on Hackage, and one could add GHC deprecated pragmas for every module, but is that the best

Re: [Haskell-cafe] Sorting efficiency

2012-08-04 Thread David Feuer
I realized my algorithm is insane. The correct way to sort [a*b|a-A, b-B] is clearly to sort A and B, then for each a in A construct either map (a*) B or map (a*) (reverse B), depending on the sign of a, then merge all these results together with a merge that collapses duplicates. I was

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Steve Severance
Actually Haskell is used in a surprising number of trading groups. However most people involved are contractually obligated to never talk about the technology in use at their firm. We make no secret that we use Haskell as our primary language in building trading systems. Other functional

Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Florian Weimer
* Vasili I. Galchin: I am going to make an assumption except for Jane Street Capital all/most Wall Street software is written in an imperative language. I expect that most of it is written in Excel, which doesn't really qualify as an imperative language. High-frequency trading is

[Haskell-cafe] Talk about Haskell at Ubucon in Berlin

2012-08-04 Thread Robert Clausecker
Hello Haskellers! I'm going to give a talk on Haskell at Ubucon 2012 in Berlin (In German). I want to give an introduction about the concept of functional programming and the special language concepts of Haskell. Any ideas what to focus on? Yours, Robert Clausecker signature.asc Description:

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Matthew
On Sat, Aug 4, 2012 at 7:05 AM, Alexander Solla alex.so...@gmail.com wrote: On Fri, Aug 3, 2012 at 11:34 PM, Matthew wonderzom...@gmail.com wrote: I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or

[Haskell-cafe] HUnit and table-driven tests

2012-08-04 Thread Matthew
I've got a function which takes in two chars, describing a playing card and a suit. An example would be 4C or TH for a 4 of Clubs or a Ten of Hearts. I need to be able to compare the ranks of a card (e.g. a King is 13), so a Card is a tuple of rank and suit. The function which parses a Card is

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Donn Cave
On Sat, Aug 4, 2012 at 7:05 AM, Alexander Solla alex.so...@gmail.com wrote: On Fri, Aug 3, 2012 at 11:34 PM, Matthew wonderzom...@gmail.com wrote: ... With do notation, I can write something like this: do foo - callFoo x bar - callBar x return (baz)