[Haskell-cafe] Re: about Haskell code written to be too smart

2009-03-26 Thread wren ng thornton
John Lato wrote: From: wren ng thornton w...@freegeek.org Dan Weston wrote: So to be clear with the terminology: inductive = good consumer? coinductive = good producer? So fusion should be possible (automatically? or do I need a GHC rule?) with inductive . coinductive

Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?

2009-03-26 Thread wren ng thornton
Alexander Dunlap wrote: wren ng thornton wrote: Jules Bean wrote: head uses error in precisely the correct, intended fashion. head has a precondition (only call on non-empty lists) And that is *exactly* my complaint: the precondition is not verified by the compiler. Therefore it does

Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?

2009-03-26 Thread wren ng thornton
Luke Palmer wrote: Alexander Dunlap wrote: Ultimately, it's not detectable statically, is it? Consider import Control.Applicative main = do f - lines $ readFile foobar print (head (head f)) You can't know whether or not head will crash until runtime. Static checkers are usually

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-26 Thread wren ng thornton
Jonathan Cast wrote: Xiao-Yong Jin wrote: Xiao-Yong Jin wrote: So I have another question. Is the following function safe and legitimate? safeDiv :: (Exception e, Integral a) = a - a - Either e a safeDiv x y = unsafePerformIO . try . evaluate $ div x y safeDiv'

Re: [Haskell-cafe] Re: Really need some help understanding a solution

2009-03-26 Thread wren ng thornton
Gü?nther Schmidt wrote: The depth this language has is just amazing and the stuff that is tackled in this language is just aaahhh. Can't quite put it in words, maybe something along the lines the ultimate thing, key to the universe I don't know. Humbling and frustrating especially when

Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-26 Thread wren ng thornton
Thomas Hartman wrote: Luke, does your explanation to Guenther have anything to do with coinduction? -- the property that a producer gives a little bit of output at each step of recursion, which a consumer can than crunch in a lazy way? It has more to do with tying the knot (using laziness to

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-31 Thread wren ng thornton
Manlio Perillo wrote: By the way, about insertWith/alter; from IntMap documentation: insertWithKey: O(min(n,W) alter: O(log n) So, alter is more efficient than insertWithKey? And what is that `W` ? As Claus says it's the maximum (value of Int; number of keys). It's in an easily overlooked

Re: [Haskell-cafe] Re: Looking for practical examples of Zippers

2009-03-31 Thread wren ng thornton
Gü?nther Schmidt wrote: Thanks Don, I followed some examples but have not yet seen anything that would show me how, for instance, turn a nested Map like Map Int (Map Int (Map String Double) into a zipped version. You can't. Or rather, you can't unless you have access to the

Re: [Haskell-cafe] about the Godel Numbering for untyped lambda calculus

2009-03-31 Thread wren ng thornton
John Tromp wrote: I am reading the book The lambda calculus: Its syntax and Semantics in the chapter about Godel Numbering but I am confused in some points. We know for Church Numerals, we have Cn = \fx.f^n(x) for some n=0, i.e. C0= \fx.x and C 1 = \fx.fx. From the above definition, I could

Re: [Haskell-cafe] Re: Looking for practical examples of Zippers

2009-04-01 Thread wren ng thornton
David Menendez wrote: On Tue, Mar 31, 2009 at 11:44 PM, wren ng thornton w...@freegeek.org wrote: Another tricky thing for this particular example is answering the question of what you want to call the focus. Usually zippered datastructures are functors, so given F X we can pick one X

Re: [Haskell-cafe] Zippers from any traversable [Was: Looking for practical examples of Zippers]

2009-04-01 Thread wren ng thornton
o...@okmij.org wrote: wren ng thornton wrote: how, for instance, turn a nested Map like Map Int (Map Int (Map String Double) into a zipped version. You can't. Or rather, you can't unless you have access to the implementation of the datastructure itself; and Data.Map doesn't provide

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-04-01 Thread wren ng thornton
Manlio Perillo wrote: wren ng thornton ha scritto: Manlio Perillo wrote: Since ratings for each customers are parsed at the same time, using a plain list would consume a lot of memory, since stream fusion can only be executed at the end of the parsing. On the other hand, when I

[Haskell-cafe] ANN: logfloat 0.12.0.1

2009-04-03 Thread wren ng thornton
-- logfloat 0.12.0.1 This package provides a type for storing numbers in the log-domain, primarily useful for preventing underflow when multiplying many probabilities as in HMMs and other probabilistic

Re: [Haskell-cafe] high probability of installation problems and quality of the glorious implementation

2009-04-05 Thread wren ng thornton
FFT wrote: John Dorsey wrote: Once it's installed and working, GHC's a very decent compiler. My general null hypothesis is, as Alec Baldwin put it, that a loser is a loser, or a buggy project is buggy. If GHC is robust overall (which I'm yet to find out), why is the installation so broken?

Re: [Haskell-cafe] tail recursion

2009-04-07 Thread wren ng thornton
Daryoush Mehrtash wrote: Is the call to go in the following code considered as tail recursion? data DList a = DLNode (DList a) a (DList a) mkDList :: [a] - DList a mkDList [] = error must have at least one element mkDList xs = let (first,last) = go last xs first in first

Re: [Haskell-cafe] Looking for the fastest Haskell primes algorithm

2009-04-15 Thread wren ng thornton
Edward Kmett wrote: You might want to start with the Sieve of Atkin: http://en.wikipedia.org/wiki/Sieve_of_Atkin Also worth reading _Lazy wheel sieves and spirals of primes_: http://www.cs.york.ac.uk/ftpdir/pub/colin/jfp97lw.ps.gz -- Live well, ~wren

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-26 Thread wren ng thornton
On 1/26/11 5:51 AM, Maciej Piechotka wrote: Some projects (like Linux) remove this clause and I'm not sure how many projects are marked on hackage as GPL2 being GPL2-only. Technically GPLx and GPLy are incompatible for all x and y such that x /= y. The problem is that *technically* the

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-28 Thread wren ng thornton
On 1/28/11 7:25 AM, Maciej Piechotka wrote: On Thu, 2011-01-27 at 19:36 -0500, wren ng thornton wrote: you distribute your work as GPL2 and someone does some derivative work that they want to distribute as GPL3, then technically they must distribute the composite work under the *joint* license

[Haskell-cafe] Problems with iteratees

2011-02-02 Thread wren ng thornton
I'm working on a project that's using John Lato's old implementation of iteratees (iteratee = 0.3.5 0.4; I'm hoping to migrate to 0.7 soon, but that's a ways off yet) and I'm running into some issues I haven't been able to untangle. Maybe a new set of eyes can help... The overarching

Re: [Haskell-cafe] Problems with iteratees

2011-02-03 Thread wren ng thornton
On 2/2/11 11:25 PM, Maciej Wos wrote: I think the problem is that the iteratee you give to I.convStream always returns Just [something] while you should return Nothing on EOF. That makes sense for the hanging problem (which I only noticed during debugging). Though I still get the the same

Re: [Haskell-cafe] Problems with iteratees

2011-02-03 Thread wren ng thornton
On 2/3/11 8:05 AM, John Lato wrote: I don't have too much to add to Maciej and Oleg's reply, except that I'd recommend looking at the Wave codec over the Tiff reader in those versions of iteratee. I don't think that's the only problem, though, because then you'd be getting a Divergent iteratee

Re: [Haskell-cafe] OSX i386/x86 and x86_64 - time to switch supported platforms?

2011-02-03 Thread wren ng thornton
On 2/3/11 10:48 AM, Max Cantor wrote: Does it make sense to relegate OSX x86_64 to community status while the 32-bit version is considered a supported platform? I'm not sure I can make sense of what you mean here. Given the preamble, I'd guess you're asking whether we should make x86_64 the

Re: [Haskell-cafe] Problems with iteratees

2011-02-03 Thread wren ng thornton
On 2/3/11 7:19 PM, Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2/3/11 19:16 , Brandon S Allbery KF8NH wrote: POSIX FIFOs and GHC's nonblocking file descriptors implementation don't play well together; you should launch the writer end first and let it block

Re: [Haskell-cafe] OSX i386/x86 and x86_64 - time to switch supported platforms?

2011-02-03 Thread wren ng thornton
Max Cantor wrote: someone? wrote: I think the original poster is saying that the targeted architecture for OS X support should be the architecture that OS X assumes by default, and these days that's x86_64. That sounds reasonable to me. The big caveat is that OSX = 10.5.8 10.6 should

Re: [Haskell-cafe] OSX i386/x86 and x86_64 - time to switch supported platforms?

2011-02-03 Thread wren ng thornton
On 2/3/11 9:28 PM, Max Cantor wrote: Doesn't 10.5.x have the ability to generate and run 64-bit binaries? Yes, it does. But it defaults to 32-bit as I recall. Richard O'Keefe suggested a general practice of targeting the architecture considered default by the operating system. That's a good

Re: [Haskell-cafe] Problems with iteratees

2011-02-04 Thread wren ng thornton
I managed to track down the problem at last. And, as might be expected after staring at it for so long, it was a fairly boneheaded thing. Turns out the error was from an entirely different thread which is using Attoparsec and a modified version of attoparsec-iteratee. I never suspected this

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread wren ng thornton
On 2/5/11 4:26 AM, Claus Reinke wrote: Lately I've been trying to go the other direction: make a large section of formerly strict code lazy. There used to be a couple of tools trying to make suggestions when a function could be made less strict (Olaf Chitil's StrictCheck and another that

[Haskell-cafe] Concurrency best practices?

2011-02-05 Thread wren ng thornton
So I'm working on a project that uses STM to run a lot of things in parallel without the headaches of locks. So far it's working beautifully, STM rocks. But there's one snag... Sometimes I need those threads to do some IO like printing logging info. I'd like to make these IO chunks atomic

Re: [Haskell-cafe] Byte Histogram

2011-02-06 Thread wren ng thornton
On 2/6/11 4:53 PM, Ivan Lazar Miljenovic wrote: On 7 February 2011 08:12, Alexey Khudyakovalexey.sklad...@gmail.com wrote: Also there is a container-classes package which provide set of type class for containers. [1] http://hackage.haskell.org/package/container-classes Don't use that

Re: [Haskell-cafe] Cabal license combinations

2011-02-10 Thread wren ng thornton
On 2/7/11 9:42 AM, Malcolm Wallace wrote: To combine licences, just aggregate them. There is no lattice of subsumption; no more or less restrictive ordering. It's simple: you must obey all of them. In the event that my comments on the previous thread were a source of confusion, I agree with

Re: [Haskell-cafe] Byte Histogram

2011-02-10 Thread wren ng thornton
On 2/8/11 6:00 AM, Ketil Malde wrote: This does seem a bit excessive. As a start, I don't remember anyone asking for control over (un)boxedness, so hopefully we could jettison that part of it? Uh, you mean like in IOUArrays, the UNPACK pragma, or -funbox-strict-fields? Unboxing is an

[Haskell-cafe] ANN: bytestring-trie 0.2.3

2011-02-12 Thread wren ng thornton
-- bytestring-trie 0.2.3 A long-awaited release for efficient finite maps from (byte)strings to values. This version adds a number of new functions for taking advantage of the trie structure. At the

Re: [Haskell-cafe] Proving correctness

2011-02-13 Thread wren ng thornton
On 2/12/11 11:41 AM, Tim Chevalier wrote: What's important is not just that Haskell has static typing, but that algebraic data types are a rich enough language to let you express your intent in data and not just in code. That helps you help the compiler help you. ADTs are an amazing thing to

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-19 Thread wren ng thornton
On 2/18/11 8:38 PM, Johan Tibell wrote: Hi all, I am delighted to announce the release of preview versions of two new packages: unordered-containers 0.1 Efficient hashing-based container types. http://hackage.haskell.org/package/unordered-containers How does, or will, this package differ

Re: [Haskell-cafe] Performance difference between ghc and ghci

2011-02-21 Thread wren ng thornton
On 2/22/11 2:26 AM, C K Kashyap wrote: Hi, Is there a runtime performance difference between a haskell program running under GHCI vs in its compiled form? Especially for a long running program - as in, ignoring the initial setup time. If I understand right, in both case tree reduction is what is

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-23 Thread wren ng thornton
On 2/23/11 4:42 PM, Sterling Clover wrote: A quick grep of some of my own source reveals that I've used M.size and S.size only to test for sizes equal to 1. So, for my purposes at least, an O(1) isSingleton operation would be just as useful as an O(1) size. I agree, a fast isSingleton

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-24 Thread wren ng thornton
On 2/23/11 8:06 PM, wren ng thornton wrote: On 2/23/11 4:42 PM, Sterling Clover wrote: A quick grep of some of my own source reveals that I've used M.size and S.size only to test for sizes equal to 1. So, for my purposes at least, an O(1) isSingleton operation would be just as useful as an O(1

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-24 Thread wren ng thornton
On 2/24/11 3:05 AM, Joachim Breitner wrote: Hi, Am Mittwoch, den 23.02.2011, 20:06 -0500 schrieb wren ng thornton: On 2/23/11 4:42 PM, Sterling Clover wrote: A quick grep of some of my own source reveals that I've used M.size and S.size only to test for sizes equal to 1. So, for my purposes

Re: [Haskell-cafe] Fun with the ST monad

2011-02-24 Thread wren ng thornton
On 2/24/11 3:45 PM, Andrew Coppin wrote: OK, so I had a function that looks like transform :: [Word8] - [Word16] It works nicely, but I'd like to use mutable state inside. No problem! Use the ST monad. Something like transform :: [Word8] - [Word16] transform xs = runST (work xs) where work ::

Re: [Haskell-cafe] Fun with the ST monad

2011-02-25 Thread wren ng thornton
On 2/25/11 2:24 PM, Andrew Coppin wrote: I've heard much about this iteratee things, but I've never looked into what the hell it actually is. Today I had a look at TMR #16, which is an explanation which I can just about follow. It seems that it's actually a kind of fold - not unlike the streams

Re: [Haskell-cafe] trac.haskell.org problem

2011-02-28 Thread wren ng thornton
On 2/28/11 2:50 AM, Niklas Broberg wrote: Ah, I suppose that's to do with the trac server itself, that's beyond me. Moving to café: Does anyone know what's up with trac.haskell.org not sending out verification emails? Having just signed up, like a few hours ago, it took a long while for the

Re: [Haskell-cafe] A practical Haskell puzzle

2011-02-28 Thread wren ng thornton
On 2/28/11 6:01 AM, Yves Parès wrote: takeC :: Int - Compoz a b - (exists c. Compoz a c) dropC :: Int - Compoz a b - (exists c. Compoz c b) What does 'exists' means? To create a rank-2 type can't you use: takeC :: Int - Compoz a b - (forall c. Compoz a c) ?? For any A and T,

Re: [Haskell-cafe] A practical Haskell puzzle

2011-02-28 Thread wren ng thornton
On 2/28/11 2:43 AM, Yitzchak Gale wrote: You have written a large software system in Haskell. Wishing to play to Haskell's strength, you have structured your system as a series of composable layers. So you have data types Layer1, Layer2, ... and functions layer2 :: Layer1 - Layer2 layer3 ::

Re: [Haskell-cafe] Project structure

2011-03-03 Thread wren ng thornton
On 3/3/11 3:33 AM, Hauschild, Klaus (EXT) wrote: Hi Haskellers, is there a recommended structure for Haskell projects. I like the Maven way (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) for Java projects. How to separate productive from test

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread wren ng thornton
On 3/3/11 7:18 PM, Jacek Generowicz wrote: Hi Cafe, It seems that I don't understand what groupBy does. I expect it to group together elements as long as adjacent ones satisfy the predicate, so I would expect ALL four of the following to give one group of 3 and a group of 1. Prelude :m +

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread wren ng thornton
On 3/3/11 8:14 PM, Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/3/11 20:09 , Jacek Generowicz wrote: 1 2 ok, same group 1 3 dito 1 2 dito Thus you get [[1,2,3,2]] OK, that works, but it seems like a strange choice ... Stability is often valued in

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread wren ng thornton
On 3/3/11 2:58 AM, Antti-Juhani Kaijanaho wrote: On Thu, Mar 03, 2011 at 12:29:44PM +0530, Karthick Gururaj wrote: Thanks - is this the same unit that accompanies IO in IO () ? In any case, my question is answered since it is not a tuple. It can be viewed as the trivial 0-tuple. Except that

Re: [Haskell-cafe] Thoughts on program annotations.

2011-03-03 Thread wren ng thornton
On 3/4/11 1:32 AM, Jason Dusek wrote: Hi List, I am working on a Bash config generation system. I've decided to factor out the Bash AST and pretty printer, here in a pre-release state: https://github.com/solidsnack/bash Awesome! Given that every statement has an

Re: [Haskell-cafe] Thoughts on program annotations.

2011-03-05 Thread wren ng thornton
On 3/4/11 2:32 PM, Jason Dusek wrote: On Fri, Mar 4, 2011 at 07:01, wren ng thorntonw...@freegeek.org wrote: where the annotation of MergeAnn is merged with the previous annotation up the tree (via mappend), thus allowing for annotations to be inherited and modified incrementally based on the

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-05 Thread wren ng thornton
On 3/4/11 4:33 PM, Alexander Solla wrote: On Thu, Mar 3, 2011 at 10:14 PM, wren ng thorntonw...@freegeek.org wrote: On 3/3/11 2:58 AM, Antti-Juhani Kaijanaho wrote: On Thu, Mar 03, 2011 at 12:29:44PM +0530, Karthick Gururaj wrote: Thanks - is this the same unit that accompanies IO in IO ()

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-07 Thread wren ng thornton
On 3/7/11 6:38 PM, Alexander Solla wrote: 'seq' is not a function, since it breaks referential transparency and possibly extensionality in function composition. By construction, seq a b = b, and yet seq undefined b /= b. Admittedly, the Haskell report and the GHC implementation, diverge on

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-07 Thread wren ng thornton
On 3/7/11 6:58 PM, Alexander Solla wrote: The magic semantics of evaluating the first argument are done by the compiler/runtime, and are apparently not expressible in Haskell. Of course this is true. The only ways of forcing evaluation in Haskell are (a) to perform pattern matches on a value,

Re: [Haskell-cafe] Haskell mail server fail?

2011-03-09 Thread wren ng thornton
Like Kenneth Hoste, I haven't been receiving mails from haskell-cafe@ nor libraries@ for a few days to a week now. What is the status of the mailing lists? (Please CC me off-list, for obvious reasons) -- Live well, ~wren ___ Haskell-Cafe mailing

Re: [Haskell-cafe] haskell mailing lists followup?

2011-03-15 Thread wren ng thornton
On 3/14/11 2:01 AM, pt...@acanac.net wrote: Hi Wren; I CC'ed you on email I sent Thu, 10 Mar after seeing your post on haskell-cafe Thu Mar 10 07:24:45 CET Haskell mail server fail?. Did you see that email? I didn't see it; though it looks like it just showed up in my inbox. The only other

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread wren ng thornton
On 3/16/11 9:52 AM, Andrew Coppin wrote: Hmm, yes. That will work, but I wonder if there's some way of doing this that doesn't limit the scope of the container to one single span of code... You can write helper functions which take containers as argument by parameterizing these helper

[Haskell-cafe] Haskell report minutiae

2011-03-17 Thread wren ng thornton
So I have a rules-lawyering question about how specified the overflow behavior is for the types Int and Word. * In the Haskell 2010 report it seems to be specified that (sections 18.1, 23.1): All arithmetic is performed modulo 2^n, where n is the number of bits in the type. And this seems to

[Haskell-cafe] Defining subtraction for naturals

2011-03-17 Thread wren ng thornton
Another question on particulars. When dealing with natural numbers, we run into the problem of defining subtraction. There are a few reasonable definitions: (1) If the result would drop below zero then throw an overflow error; (2) Use saturating subtraction, i.e. if the result would drop

Re: [Haskell-cafe] [Agda] Defining subtraction for naturals

2011-03-17 Thread wren ng thornton
On 3/17/11 2:50 PM, Luke Palmer wrote: If you are implementing lazy naturals, I wonder if defining 0 - 1 to be infinity makes mathematical sense. It's like arithmetic mod infinity Actually, I'm specifically implementing strict naturals :) There are a number of libraries for lazy naturals

Re: [Haskell-cafe] How large is the Haskell community ?

2011-03-17 Thread wren ng thornton
On 3/17/11 9:18 AM, Andy Stewart wrote: On Sat, Feb 12, 2011 at 6:57 PM, Jan Christiansenj...@informatik.uni-kiel.de wrote: if you have written at least 1 lines of code in Haskell, Goodness. It looks like my current project is over 17,275 lines including documentation but excluding

Re: [Haskell-cafe] Defining subtraction for naturals

2011-03-17 Thread wren ng thornton
On 3/17/11 3:30 PM, David Menendez wrote: In What About the Natural Numbers, Colin Runciman argues for [...] Thanks for the reference, I'll go check it out. -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] [Agda] Defining subtraction for naturals

2011-03-17 Thread wren ng thornton
On 3/17/11 4:22 PM, Martin Escardo wrote: On 17/03/11 18:35, wren ng thornton wrote: (2) Use saturating subtraction, i.e. if the result would drop below zero then return zero; This is what people working with quantales do. Subtraction y-z, when it exists, is the solution in s to the equation

Re: [Haskell-cafe] [Agda] Defining subtraction for naturals

2011-03-17 Thread wren ng thornton
On 3/17/11 5:12 PM, Conor McBride wrote: On 17 Mar 2011, at 18:35, wren ng thornton wrote: Another question on particulars. When dealing with natural numbers, we run into the problem of defining subtraction. There are a few reasonable definitions: No there aren't. How about pragmatically

[Haskell-cafe] ANN: unix-bytestring: Unix/Posix-specific functions for ByteStrings.

2011-03-20 Thread wren ng thornton
-- unix-bytestring 0.3.2 The unix-bytestring package offers a full selection of Unix/Posix-specific functions for reading and writing ByteStrings to Fds. --

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-26 Thread wren ng thornton
On 3/26/11 4:33 PM, John A. De Goes wrote: 4. Iteratees cannot incrementally produce output, it's all or nothing, which makes them terrible for many real world problems that require both incremental input and incremental output. For this one, enumeratees are the proposed solution. But for

[Haskell-cafe] ANN: unix-bytestring 0.3.4

2011-03-26 Thread wren ng thornton
-- unix-bytestring 0.3.4 The unix-bytestring package offers a full selection of Unix/Posix-specific functions for reading and writing ByteStrings to Fds. --

Re: [Haskell-cafe] Three Google Summer of Code project proposals

2011-03-27 Thread wren ng thornton
On 3/27/11 7:16 AM, Johan Tibell wrote: On Sun, Mar 27, 2011 at 1:03 PM, Andrew Coppin andrewcop...@btinternet.com wrote: *** Build multiple Cabal packages in parallel *** http://hackage.haskell.org/trac/summer-of-code/ticket/1594 Many developers have multi-core machines but Cabal runs the

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-27 Thread wren ng thornton
On 3/27/11 11:38 AM, John A. De Goes wrote: Enumeratees solve some use cases but not others. Let's say you want to incrementally compress a 2 GB file. If you use an enumeratee to do this, your transformer iteratee has to do IO. I'd prefer an abstraction to incrementally and purely produce the

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-27 Thread wren ng thornton
On 3/27/11 9:58 PM, John Millikin wrote: Resending is slightly more complex -- if the other end can say resend that last chunk, then it should be easy enough, but resend the last 2 bytes of that chunk you sent 5 minutes ago would be much harder. What is your use case? This does highlight one

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-29 Thread wren ng thornton
On 3/29/11 4:40 AM, o...@okmij.org wrote: Wren Thornton wrote: This is often conflated with the iteratee throwing an error/exception, which is wrong because we should distinguish between bad program states and argument passing. I guess this is a matter of different points of view on

Re: [Haskell-cafe] using IO monad in Iteratee

2011-04-01 Thread wren ng thornton
On 4/1/11 3:59 PM, Dmitry Olshansky wrote: But enumFile use IO monad instead of MonadIO class. [...] Is it possible to change enumFile to using MonadIO class? Unless its changed significantly since I looked at it last (which it may well have), it's not possible. The problem is that what we'd

[Haskell-cafe] ANN: stm-chans: Additional types of channels for STM.

2011-04-03 Thread wren ng thornton
-- stm-chans 1.0.0 The stm-chans package offers a collection of channel types, similar to Control.Concurrent.STM.TChan but with additional features. In particular it offers these types: *

Re: [Haskell-cafe] ANN: stm-chans: Additional types of channels for STM.

2011-04-05 Thread wren ng thornton
On 4/3/11 11:58 PM, Thomas DuBuisson wrote: Wren, Glad to see someone is doing a more complete packaging of STM helpers and derivatives! I've done a little work on bounded TChans[1] (hackage bounded-tchan package) and I think you should consider a few things: Ah, somehow I missed that in my

Re: [Haskell-cafe] Using _ on the RHS of an equation?

2011-04-05 Thread wren ng thornton
On 4/4/11 4:42 PM, Jason Dagit wrote: Is this something people would be interested in having as an extension in GHC? Or is it just too fluffy for anyone to really care? I'd much rather have _ on the RHS of equations be a way of specifying terms that the compiler should infer. This is pretty

Re: [Haskell-cafe] Using _ on the RHS of an equation?

2011-04-05 Thread wren ng thornton
On 4/5/11 11:22 PM, Ivan Lazar Miljenovic wrote: On 6 April 2011 13:13, wren ng thorntonw...@freegeek.org wrote: On 4/4/11 4:42 PM, Jason Dagit wrote: Is this something people would be interested in having as an extension in GHC? Or is it just too fluffy for anyone to really care? I'd

Re: [Haskell-cafe] Testing Implementation vs Model - Records or Type Classes?

2011-04-08 Thread wren ng thornton
On 4/8/11 8:55 AM, Twan van Laarhoven wrote: -- this class is useful beyond this FRP library, -- you might already be able to find it on hackage somewhere class Functor f = Filterable f where filter :: (a - Bool) - f a - f a -- filter p . fmap f == fmap f . filter (p . f) -- filter (const True)

Re: [Haskell-cafe] Is there a way to find out the type inferred for a local function inside another function? :)

2011-04-08 Thread wren ng thornton
On 4/8/11 8:24 AM, Henning Thielemann wrote: Magnus Therning schrieb: AFAIK there is no way to do that, thouhg scion[1] may offer it. Personally I develop more complex local functions at the top-level, and once I'm happy with it I perform some re-factoring and move it in. I would not write

Re: [Haskell-cafe] import functionality in DSLs

2011-04-17 Thread wren ng thornton
On 4/16/11 9:55 AM, Felipe Almeida Lessa wrote: On Sat, Apr 16, 2011 at 10:29 AM, Nikhil A. Patil patil.nik...@gmail.com wrote: doit :: DSL Term doit = do (+)- (+) n0- n0 k- k -- begin beautiful DSL code let x = k + n0 return $ x + x I

[Haskell-cafe] Unicode normalization

2011-04-19 Thread wren ng thornton
Hello all, I'm in need of a Unicode normalization function, Utf8 NFC for ByteString in particular. From some quick Googling around it looks like the only available option is to use ICU in some form. The text-icu package has a nice binding to it, but unfortunately that means a lot of redundant

Re: [Haskell-cafe] Why not Darcs?

2011-04-21 Thread wren ng thornton
On 4/21/11 10:33 PM, Simon Michael wrote: +1 to what you said. On 4/21/11 4:16 PM, John Meacham wrote: Incidentally, I wrote a github like site based around darcs a few years ago at codehole.org. It is just used internally by me for certain projects. but if people were interested, I could

Re: [Haskell-cafe] Why not Darcs?

2011-04-22 Thread wren ng thornton
On 4/22/11 11:39 AM, Simon Michael wrote: On 4/21/11 10:16 PM, wren ng thornton wrote: rather, what I'd like is someplace to keep my code which also provides a good bugtracker. Unfortunately, neither darcsden nor patchtag offer darcsden does include a simple issue tracker now. Ah, excellent

Re: [Haskell-cafe] Is Hugs dead?

2011-04-22 Thread wren ng thornton
On 4/22/11 8:16 AM, Robert Clausecker wrote: Some weeks ago, I mirrored the hugs repo to github. (https://github.com/fuzxxl/Hugs) This was, when I found out, that the last commit was about 2 years ago. Also, since some of the dependencies moved, I was unable to build hugs. Now my question is:

Re: [Haskell-cafe] There is no null; Maybe/Option types

2011-04-22 Thread wren ng thornton
On 4/22/11 3:26 PM, Henning Thielemann wrote: On Fri, 22 Apr 2011, Christopher Done wrote: Use of Fantom's save invoke and Maybe are more or less the same. -- Hard way email = if userList /= Nothing then let user = findUser bob (fromJust userList) in if user /=

Re: [Haskell-cafe] naming convention for maybes?

2011-04-22 Thread wren ng thornton
On 4/22/11 1:14 PM, Evan Laforge wrote: Here's a simple issue that's been with me for a while. As do many people, I use plural variable names for lists, so if a Block as called 'block' then [Block] is 'blocks'. The other pattern that comes up a lot is 'Maybe Block'. When I have to name it, I

Re: [Haskell-cafe] Storing failing testcases for QuickCheck

2011-04-23 Thread wren ng thornton
On 4/23/11 8:02 AM, Sönke Hahn wrote: Hi! I would like to have a library that would allow to use QuickCheck in the normal manner, but it would save test data for failing properties on the filesystem (maybe using the shiny new acid-state?). On consecutive test runs, the saved test data would be

[Haskell-cafe] A parallelization problem

2011-04-24 Thread wren ng thornton
Hello all, I have some loopy code I'd like to make parallel, but I'm not sure the best way to go about it. Everywhere else in this program I'm using STM, but that seems pretty heavy-handed for this task, and it looks like the perfect place for `par` and friends. So the 10,000ft view of the

Re: [Haskell-cafe] There is no null; Maybe/Option types

2011-04-28 Thread wren ng thornton
On 4/26/11 9:55 AM, Ertugrul Soeylemez wrote: wren ng thorntonw...@freegeek.org wrote: But the greatest thing about Maybe is that you don't *have* to write code in monadic style. Because Maybe makes explicit the null-pointer shenanigans in other languages, you can simply unwrap the Maybe and

Re: [Haskell-cafe] Usage of rewrite rule specialization in Hackage

2011-05-05 Thread wren ng thornton
On 5/5/11 10:36 AM, Scott Kilpatrick wrote: I'm looking for real code that uses the kind of GHC rewrite rule that specializes a polymorphic function with another one, as described herehttp://www.haskell.org/ghc/docs/latest/html/users_guide/rewrite- rules.html#rule-spec. Can anyone point me to

Re: [Haskell-cafe] ANNOUNCE: iterIO-0.1 - iteratee-based IO with pipe operators

2011-05-06 Thread wren ng thornton
On 5/6/11 11:15 AM, Alex Mason wrote: Hi All, I really love the look of this package, but if this is going be *the* iteratee package, I would absolutely love to see it fix some of the biggest mistakes in the other iteratee packages, soecifically naming. A change in naming for the terms

[Haskell-cafe] ANN: stm-chans 1.2.0

2011-05-07 Thread wren ng thornton
-- stm-chans 1.2.0 The stm-chans package offers a collection of channel types, similar to Control.Concurrent.STM.TChan but with additional features. --

Re: [Haskell-cafe] Those damned parentheses

2011-05-07 Thread wren ng thornton
On 5/7/11 4:29 PM, Eitan Goldshtrom wrote: I know about the $ symbol, that's why it's in there in the respective places. I see that I can use it to fix my problem, but I was trying to figure out function composition really. I guess that's just not the place for it. I'll check out

Re: [Haskell-cafe] ANNOUNCE: iterIO-0.1 - iteratee-based IO with pipe operators

2011-05-07 Thread wren ng thornton
On 5/7/11 5:15 PM, dm-list-haskell-c...@scs.stanford.edu wrote: In general, I try to place as few requirements in the contexts of functions as possible. One counterargument to this philosophy is that there are many cases where fmap can be defined more efficiently than the liftM derived from

Re: [Haskell-cafe] parsing currency amounts with parsec

2011-05-09 Thread wren ng thornton
On 5/9/11 10:04 PM, Antoine Latter wrote: On Mon, May 9, 2011 at 5:07 PM, Eric Rasmussenericrasmus...@gmail.com wrote: Hi everyone, I am relatively new to Haskell and Parsec, and I couldn't find any articles on parsing numbers in the following format: Positive: $115.33 Negative: ($1,323.42)

Re: [Haskell-cafe] Exception for NaN

2011-05-14 Thread wren ng thornton
On 5/12/11 3:22 PM, Andrew Coppin wrote: There is an isNaN function somewhere. N.B., on Hugs (September 2006), isNaN is flagrantly broken; so is isInfinite. I have a solution available[1], but alas, it seems unlikely to ever make its way back upstream. Moral: double check your compiler

Re: [Haskell-cafe] why doesn't ghc give you a type signature that works ?

2011-05-17 Thread wren ng thornton
On 5/17/11 11:53 PM, KC wrote: If you're importing the module as import qualified Math.FFT as FFT Shouldn't Math.FFT become FFT? :) Nope. Depending on your definition of should at least. Hierarchical modules are not considered entities exported by modules further up on the tree. So

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-18 Thread wren ng thornton
On 5/18/11 2:25 PM, Tom Murphy wrote: I'd give three reasons for disagreeing: 1. Developing a complete GUI has been a low priority up until now, but now that other, more urgent areas of development are starting to thrive, its time has come. 2. Yes, having essentially no complete GUI support has

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-18 Thread wren ng thornton
On 5/18/11 10:54 PM, Manuel M T Chakravarty wrote: Nevertheless, there are good reasons to develop native applications (especially on the Mac with its user-base spoiled by high-end UX). Luckily, the choice of toolkit is trivial in this case. For Mac OS, we need a Haskell-Cocoa binding. I

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread wren ng thornton
On 5/19/11 5:51 PM, Antoine Latter wrote: On Thu, May 19, 2011 at 3:06 PM, Simon Meieriridc...@gmail.com wrote: The core problem that drove me towards this solution is the abundance of different IntX and WordX types. Each of them requiring a separate Write for big-endian, little-endian,

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

2011-05-21 Thread wren ng thornton
On 5/21/11 3:56 PM, Aleksandar Dimitrov wrote: 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

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

2011-05-23 Thread wren ng thornton
On 5/22/11 8:40 AM, Aleksandar Dimitrov wrote: If you have too much trouble trying to get SRILM to work, there's also the Berkeley LM which is easier to install. I'm not familiar with its inner workings, but it should offer pretty much the same sorts of operations. Do you know how BerkeleyLM

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread wren ng thornton
On 5/25/11 1:56 PM, Antoine Latter wrote: On May 25, 2011 12:50 PM,qu...@sparq.org wrote: Quoting Antoine Latteraslat...@gmail.com: The only thing I'd add would be the additional actions ReplacedBy, ExtendedBy and RedesignedBy. I was actually thinking that this was the part that HackageDB

<    2   3   4   5   6   7   8   9   10   >