Re: [Haskell-cafe] Proposal: New syntax for Haskell

2013-09-12 Thread Bob Ippolito
Have you tried AppleScript? I wouldn't say it's pleasant to use, but it's easy to read. On Thursday, September 12, 2013, David Thomas wrote: I've long been interested in a scripting language designed to be spoken. Not interested enough to go about making it happen... but the idea is

Re: [Haskell-cafe] Reasoning about performance

2013-09-03 Thread Bob Ippolito
Haskell's non-strict evaluation can often lead to unexpected results when doing tail recursion if you're used to strict functional programming languages. In order to get the desired behavior you will need to force the accumulator (with something like Data.List's foldl', $!, seq, BangPatterns,

Re: [Haskell-cafe] function arithmetic?

2013-09-01 Thread Bob Ippolito
Yes, you can do that, but you probably shouldn't. See also: http://www.haskell.org/haskellwiki/Num_instance_for_functions http://hackage.haskell.org/package/applicative-numbers On Sat, Aug 31, 2013 at 10:01 PM, Christopher Howard christopher.how...@frigidcode.com wrote: Hi. I was just

Re: [Haskell-cafe] Debugging ByteString and Data.Binary.Get memory usage

2013-08-29 Thread Bob Ippolito
Building a map with foldr seems unwise, have you tried doing it with fromListWith instead? Or foldl'? In either case, since you don't even put the map into WHNF, none of the computation is done at all in either case until the first lookup. On Thu, Aug 29, 2013 at 3:35 PM, Kyle Hanson

Re: [Haskell-cafe] Debugging ByteString and Data.Binary.Get memory usage

2013-08-29 Thread Bob Ippolito
the sequential IO action that my server uses to populate the Map. I found the problem to be that I need to force the map to evaluate so adding a little $! fixed the problem -- Kyle Hanson On Thu, Aug 29, 2013 at 9:09 PM, Bob Ippolito b...@redivi.com wrote: Building a map with foldr seems unwise

Re: [Haskell-cafe] translating recursively defined sequence

2013-03-04 Thread Bob Ippolito
I suppose it depends on your definition of straightforward but you can use the iterate function from Data.List to quickly define sequences like this. a = iterate (\x - (1/5) * (x**2)) 10 On Mon, Mar 4, 2013 at 9:19 PM, Christopher Howard christopher.how...@frigidcode.com wrote: Hi. My

Re: [Haskell-cafe] How does one create an input handle bound to a string instead of a file?

2013-02-27 Thread Bob Ippolito
I haven't had time to make an example yet but it looks like if you go down to GHC.IO.Handle.Internals there's a mkHandle function that takes a BufferedIO and some other stuff and gives you an IO Handle. On Wed, Feb 27, 2013 at 3:23 PM, Gregory Collins g...@gregorycollins.netwrote: Hm, perhaps

Re: [Haskell-cafe] Ticking time bomb

2013-02-12 Thread Bob Ippolito
The Python and Ruby communities are actively working on improving the security of their packaging infrastructure. I haven't paid close attention to any of the efforts so far, but anyone working on cabal/hackage security should probably take a peek. I lurk on Python's catalog-sig list and here's

Re: [Haskell-cafe] Problem installing cabal-dev

2013-02-12 Thread Bob Ippolito
The version of cabal-dev on Hackage doesn't work with recent versions of Haskell due to https://github.com/creswick/cabal-dev/issues/74 - You have to install from a recent git checkout. These instructions were done on Mac but should be straightforward enough to do the same on Windows:

Re: [Haskell-cafe] performance question

2013-02-12 Thread Bob Ippolito
On Tuesday, February 12, 2013, wrote: On Tue, 12 Feb 2013 15:57:37 -0700 Nicolas Bock nicolasb...@gmail.com javascript:; wrote: Here is haskell version that is faster than python, almost as fast as c++. You need to install bytestring-lexing package for readDouble. I was hoping

Re: [Haskell-cafe] performance question

2013-02-09 Thread Bob Ippolito
I've been playing with your example to optimize it a bit, I have to run but here's what I have so far. It's about as fast as the Python code, I'll make it faster when I have more time over the next few days. See https://gist.github.com/etrepum/4747507 and

Re: [Haskell-cafe] performance question

2013-02-08 Thread Bob Ippolito
Do you mind posting createMatrixDump.py and printMatrixDecay.py? That would certainly make it easier to help you. On Fri, Feb 8, 2013 at 11:26 AM, Nicolas Bock nicolasb...@gmail.com wrote: Hi list, I wrote a script that reads matrix elements from standard input, parses the input using a

Re: [Haskell-cafe] Ticking time bomb

2013-01-30 Thread Bob Ippolito
HTTPS doesn't really change anything if the server is compromised, it only prevents bad things from happening in transit. Sign the packages with GPG (or equivalent) before upload. The server never sees the package author's private key, only the public key. Server and/or client can warn or fail if

Re: [Haskell-cafe] Mobile app development?

2013-01-19 Thread Bob Ippolito
LLVM probably already supports producing native code for all of the architectures for the mobile platforms. The non-trivial parts are probably getting GHC to cross-compile and wrapping all of the libraries you need for the platforms you want to support. On Sat, Jan 19, 2013 at 12:41 PM, KC

Re: [Haskell-cafe] regular expression sub-expression matching

2013-01-18 Thread Bob Ippolito
Note that Haskell doesn't convert \( to \\( like Python does, so the regex string has been changed. It's not so easy to figure out how to use this library from the documentation because of all the typeclass trickery. h import Text.Regexp.Posix (getAllTextSubmatches, (=~)) h getAllTextSubmatches

Re: [Haskell-cafe] Generating random arguments for a function

2013-01-13 Thread Bob Ippolito
I think it's more complicated because he doesn't know what the return type or arity of the function is. In QuickCheck they know the return type of a property is Bool. In this case, we only know that the return type is an instance of Show. I don't think that's enough to simply implement this. On