Re: [Haskell-cafe] Diving into the records swamp (possible GSoC project)

2013-04-26 Thread Aleksandar Dimitrov
Slightly, off-topic, but just because I've been spending my last couple of days trying to shoehorn an inheritance-based subytping type system into Haskell (without full OO-power, so no methods or mutable state.) Oleg/Ralf's HList paper covers all the ground for first-class records. It depends

Re: [Haskell-cafe] Where is the convergence point between Category Theory and Haskell?

2013-01-14 Thread Aleksandar Dimitrov
[1] For more discussion on this point, see n-Lab and n-Cafe: http://ncatlab.org/ http://golem.ph.utexas.edu/category/ Wren, thanks very much for these two links. I've been trying for forever to get a foot into metamathematics and type theory in particular (not having the option of

Re: [Haskell-cafe] cabal configure cabal build cabal install

2012-12-10 Thread Aleksandar Dimitrov
On Mon, Nov 26, 2012 at 06:21:33PM -0500, Albert Y. C. Lai wrote: cabal configure is used by a lot of programmers. Today. Why? Because they use it on their own projects. They use cabal-install as a builder, not exactly an installer. Don't most devs nowadays use sandboxing, a.k.a. cabal-dev?

Re: [Haskell-cafe] Specify compile error

2012-05-03 Thread Aleksandar Dimitrov
On Thu, May 3, 2012 at 5:36 PM, Ismael Figueroa Palet ifiguer...@gmail.comwrote: Hi, I'm writing a program like this: data B = B Int data A = Safe Int | Unsafe Int createB :: A - B createB (Safe i) = B i createB (Unsafe i) = error This is not allowed Unfortunately, the situation when

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-07 Thread Aleksandar Dimitrov
: On 7/6/11 5:58 PM, Aleksandar Dimitrov wrote: On Wed, Jul 06, 2011 at 09:32:27AM -0700, wren ng thornton wrote: On 7/6/11 9:27 AM, Dmitri O.Kondratiev wrote: Hi, Continuing my search of Haskell NLP tools and libs, I wonder if the following Haskell libraries exist (googling them does

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Aleksandar Dimitrov
On Wed, Jul 06, 2011 at 09:32:27AM -0700, wren ng thornton wrote: On 7/6/11 9:27 AM, Dmitri O.Kondratiev wrote: Hi, Continuing my search of Haskell NLP tools and libs, I wonder if the following Haskell libraries exist (googling them does not help): 1) End of Sentence (EOS) Detection.

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Aleksandar Dimitrov
On Wed, Jul 06, 2011 at 11:04:30PM +0400, Dmitri O.Kondratiev wrote: On Wed, Jul 6, 2011 at 8:32 PM, wren ng thornton w...@freegeek.org wrote: On 7/6/11 9:27 AM, Dmitri O.Kondratiev wrote: Hi, Continuing my search of Haskell NLP tools and libs, I wonder if the following Haskell

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Aleksandar Dimitrov
On Wed, Jul 06, 2011 at 03:14:07PM -0700, Rogan Creswick wrote: Have you used that particular combination yet? I'd like to know the details of how you hooked everything together if that's something you can share. (We're working on a similar Frankenstein at the moment.) These Frankensteins, as

Re: [Haskell-cafe] best way to use ghc-7.0 under debian stable

2011-06-10 Thread Aleksandar Dimitrov
Hi Brian, Currently debian stable installs ghc 6.12.1. Testing also doesn't have the new ghc. Here's how I do it: I have a prefix $HOME/local/haskell, where I installed the ghc binaries (downloadable at the ghc main site.) Just use ./configure --prefix=$HOME/local/haskell. Then use the same

Re: [Haskell-cafe] Iteratees again (Was: How on Earth Do You Reason about Space?)

2011-06-02 Thread Aleksandar Dimitrov
Hi Ketil, By the way, what is the advantage of using iteratees here? For my testing, I just used: My initial move to iteratees was more a clutch call I made when I was still using bytestring-trie, and was having immense memory consumption problems. bytestring-trie uses strict byte strings as

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-06-01 Thread Aleksandar Dimitrov
Hi John, I think the issue is data sharing, as Brandon mentioned. A bytestring consists of an offset, length, and a pointer. You're using a chunk size of 64k, which means the generated bytestrings all have a pointer to that 64k of data. Suppose there's one new word in that 64k, and it's

Re: [Haskell-cafe] Computing the memory footprint of a HashMap ByteString Int (Was: How on Earth Do You Reason about Space?)

2011-06-01 Thread Aleksandar Dimitrov
Hello Johan, On Wed, Jun 01, 2011 at 08:52:04AM +0200, Johan Tibell wrote: I thought it'd be educational to do some back-of-the-envelope calculations to see how much memory we'd expect to use to store words in a HashMap ByteString Int. Thank you for your writeup, which is very informative!

[Haskell-cafe] How on Earth Do You Reason about Space?

2011-05-31 Thread Aleksandar Dimitrov
Dear Cafe, (Excuse the probably very ranty email; I am, unfortunately, at the end of my wits, and I hope that as fellow programmers, you will understand that this is among the most dreadful situations for our kind to be in.) Say, we have an input file that contains a word per line. I want to

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-05-31 Thread Aleksandar Dimitrov
On Tue, May 31, 2011 at 06:10:00PM +0200, Aleksandar Dimitrov wrote: ad a) heap consumption is too high for two reasons: firstly, the actual data I care about is much less than there's data on the heap. Secondly, about half the heap space is in LAG state. Here are profiles

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-05-31 Thread Aleksandar Dimitrov
In Lag/Drag/Void/Use profiling, Lag is actually heap cells that are created too _early_.  (Drag are those that are kept for longer than necessary.)  Lots of Lag generally means your program is too strict - it is forcing structure long before it needs to.  To fix it, you need to make things

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-05-31 Thread Aleksandar Dimitrov
Hi Johan, Here's how I would do it: I implemented your method, with these minimal changes (i.e. just using a main driver in the same file.) countUnigrams :: Handle - IO (M.Map S.ByteString Int) countUnigrams = foldLines (\ m s - M.insertWith (+) s 1 m) M.empty main :: IO () main = do

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-05-31 Thread Aleksandar Dimitrov
On Tue, May 31, 2011 at 11:30:06PM +0100, John Lato wrote: I can't reproduce the space leak here. I tried Aleksander's original code, my iteratee version, the Ngrams version posted by Johan Tibell, and a lazy bytestring version. I unfortunately can't post the actual corpus here, because it's

Re: [Haskell-cafe] Handling a large database (of ngrams)

2011-05-22 Thread Aleksandar Dimitrov
Hi Wren, First of all, thanks for your elaborate answer! Your input is very much appreciated! On Sat, May 21, 2011 at 10:42:57PM -0400, wren ng thornton wrote: I've been working on some n-gram stuff lately, which I'm hoping to put up on Hackage sometime this summer (i.e., in a month or so,

[Haskell-cafe] Handling a large database (of ngrams)

2011-05-21 Thread Aleksandar Dimitrov
Hi Haskellers, I'm unaware of a good method or default way of handling large datasets to which I need non-sequential (i.e. random) access in Haskell. My use case is linguistic analysis of a ~30GB corpus — the most basic form of quantitative analysis here are ngram based HMMs, which aren't

Re: [Haskell-cafe] Edit Hackage

2010-10-28 Thread Aleksandar Dimitrov
On Thu, 28 Oct 2010 22:44:04 +0200, Stephen Tetley stephen.tet...@gmail.com wrote: P.S. I encourage people to use the online forums: Haskell Reddit and Stack Overflow, as a lot of the question-answering activity has shifted there now, away from -cafe@ Err, Why? Having to track three places

Re: [Haskell-cafe] Re: All binary strings of a given length

2010-10-15 Thread Aleksandar Dimitrov
On Fri, 15 Oct 2010 14:34:42 +0200, rgowka1 rgow...@gmail.com wrote: Amazing, will never find this in any other languagw. But ghci crashes for bigger input. Like genbin 20. How to scale this function? Well, scaling this isn't really possible, because of its complexity. It generates all

Re: [Haskell-cafe] Hexpat: Lazy I/O problem with huge input files

2010-10-14 Thread Aleksandar Dimitrov
Hello Daniel, I don't know Hexpat at all, so I can only guess. Perhaps due to the laziness of let-bindings, mError keeps a reference to the entire tuple, thus preventing tree from being garbage collected as it is consumed by print. Thanks for your input. I think you are right, the parse

[Haskell-cafe] Hexpat: Lazy I/O problem with huge input files

2010-10-13 Thread Aleksandar Dimitrov
Hello Haskell Cafe, I really hope this is the right list for this sort of question. I've bugged the folks in #haskell, they say go here, so I'm turning to you. I want to use Hexpat to read in some humongous XML files (linguistic corpora,) since it's the only Haskell XML library (I could find)