[Haskell-cafe] ANN: bytestring-lexing 0.4.0

2012-02-03 Thread wren ng thornton
-- bytestring-lexing 0.4.0 The bytestring-lexing package offers efficient reading and packing of common types like Double and Integral types. -- Changes

Re: [Haskell-cafe] ANN: combinatorics

2012-02-05 Thread wren ng thornton
On 2/5/12 10:21 AM, Daniel Fischer wrote: Why not use one of the packages on hackage which offer faster prime generators? Mostly because I hadn't looked, having had the code already laying around. I'm not opposed to it, however another goal is to remain portable to other compilers, which

Re: [Haskell-cafe] ANN: combinatorics

2012-02-05 Thread wren ng thornton
On 2/5/12 5:40 PM, Daniel Fischer wrote: On Sunday 05 February 2012, 23:14:35, wren ng thornton wrote: On 2/5/12 10:21 AM, Daniel Fischer wrote: Why not use one of the packages on hackage which offer faster prime generators? Mostly because I hadn't looked, having had the code already laying

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-07 Thread wren ng thornton
On 2/7/12 4:52 PM, Richard O'Keefe wrote: Anyone who has had occasion to write Fortran in the last 20+ years has had to discover just how quickly you can get used to using 'record%field'. I'm not really a COBOL programmer, but Prolog and Erlang and Smalltalk taught me well that '.' in a

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-11 Thread wren ng thornton
On 2/8/12 10:10 PM, Anthony Clayden wrote: I chose the most available non-ASCII character I could find. Set the criterion to be present in most ISO 8-bit character sets and there are really only two candidates, section sign and degrees sign. ... Brilliant! We'll use degrees sign for function

Re: [Haskell-cafe] ANN: stm-conduit-0.2.1

2012-02-11 Thread wren ng thornton
On 2/9/12 2:29 PM, Felipe Almeida Lessa wrote: Your package uses TMChans which AFAIK are unbounded. That means that if the writer is faster than the reader, then everything will be kept into memory. This means that using TMChans you may no longer say that your program uses a constant amount of

[Haskell-cafe] ANN: unification-fd 0.6.0

2012-02-17 Thread wren ng thornton
-- unification-fd 0.6.0 The unification-fd package offers generic functions for single-sorted first-order structural unification (think Prolog programming or Hindley--Milner type inference)[1][2]. I've

Re: [Haskell-cafe] [haskell-cafe] Some reflections on Haskell

2012-02-17 Thread wren ng thornton
On 2/14/12 11:41 AM, Bardur Arantsson wrote: On 02/14/2012 04:13 PM, Doug McIlroy wrote: Nevertheless, I share Jardine's concern about the central problem. It is hard to find one's way in this ecosystem. It needn't be, as Java illustrates. As a professional Java developer this sounds really

Re: [Haskell-cafe] ANN: unification-fd 0.6.0

2012-02-17 Thread wren ng thornton
On 2/17/12 2:51 PM, Roman Cheplyaka wrote: Out of these FunctionalDependencies seems to be the most exotic (even in GHC-oriented development there has been some shift towards type families, it seems). Is it used only for mtl stuff (and thus can be replaced by 'transformers' + some lifts), or is

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-21 Thread wren ng thornton
On 2/21/12 2:17 AM, Roman Cheplyaka wrote: * Sebastian Fischerfisc...@nii.ac.jp [2012-02-21 00:28:13+0100] On Mon, Feb 20, 2012 at 7:42 PM, Roman Cheplyakar...@ro-che.info wrote: Is there any other interpretation in which the Reader monad obeys the laws? If selective strictness (the seq

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-21 Thread wren ng thornton
On 2/19/12 10:44 PM, Jack Henahan wrote: (or any other method which applies the quarantine flag) And you can always use xattr in order to delete that flag, if need be. -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Haskell development in Mac OS X after Gatekeeper

2012-02-21 Thread wren ng thornton
On 2/20/12 4:31 PM, Richard O'Keefe wrote: On 20/02/2012, at 5:53 PM, Brandon Allbery wrote: Bzuh? Since you are running Lion and I am not, it isn't _that_ surprising that we see different things. It remains surprising that in 10.6.8 the xattr command is there but its manual page is not.

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-21 Thread wren ng thornton
On 2/21/12 11:27 AM, MigMit wrote: Ehm... why exactly don't domain products form domains? One important property of domains[1] is that they have a unique bottom element. Given domains A and B, let us denote the domain product as: (A,B) def= { (a,b) | a - A, b - B } Which will inherit

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-21 Thread wren ng thornton
On 2/21/12 11:54 AM, Dan Doel wrote: On Tue, Feb 21, 2012 at 10:44 AM, wren ng thorntonw...@freegeek.org wrote: That's a similar sort of issue, just about whether undefined == (undefined,undefined) or not. If the equality holds then tuples would be domain products[1], but domain products do

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-21 Thread wren ng thornton
On 2/21/12 11:54 AM, Dan Doel wrote: You don't have to get rid of bottom entirely (I think). If you make matches against products irrefutable, then you're again in the situation of seq being the only thing able to distinguish between _|_ and (_|_, _|_), so we could keep the current

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-21 Thread wren ng thornton
On 2/22/12 1:45 AM, Miguel Mitrofanov wrote: However, there is no free ordering on: { (a0,b) | b- B } \cup { (a,b0) | a- A } What? By definition, since, a0= a and b0= b, we have (a0, b0)= (a0, b) and (a0, b0)= (a0, b0), so, (a0, b0) is clearly the bottom of A\times B. Sorry, the

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-22 Thread wren ng thornton
On 2/22/12 2:20 AM, wren ng thornton wrote: On 2/22/12 1:45 AM, Miguel Mitrofanov wrote: However, there is no free ordering on: { (a0,b) | b - B } \cup { (a,b0) | a - A } What? By definition, since, a0 = a and b0 = b, we have (a0, b0) = (a0,b) and (a0, b0) = (a0, b0), so, (a0, b0) is clearly

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-22 Thread wren ng thornton
On 2/22/12 2:37 AM, Dan Doel wrote: unless I'm still sketchy on what you mean by domain. I don't think it matters that we're only considering strict homomorphisms. I think part of the problem is that there are many different ideas of what exact properties a domain has. The one I'm most

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-22 Thread wren ng thornton
On 2/21/12 10:44 AM, wren ng thornton wrote: but domain products do not form domains! In order to get a product which does form a domain, we'd need to use the smash product[2] instead. Unfortunately we can't have our cake and eat it too Bah, I don't know why my wires were crossed yesterday

Re: [Haskell-cafe] Data.IntMap union complexity

2012-02-23 Thread wren ng thornton
On 2/23/12 9:16 PM, Clark Gaebel wrote: Looking at IntMap's left-biased 'union' function [1], I noticed that the complexity is O(n+m) where n is the size of the left map, and m is the size of the right map. Since insertion [2] is O(min(n, W)) [ where W is the number of bits in an Int ],

[Haskell-cafe] Hackage documentation down?

2012-02-23 Thread wren ng thornton
Hello all, I posted a minor update to unix-bytestring a few days ago in order to deal with the Num not implying Eq thing in GHC 7.4, but it looks like the documentation still hasn't been made (nor the built-on field). Are the Hackage builders down intentionally since the recent crash, or

Re: [Haskell-cafe] Data.IntMap union complexity

2012-02-23 Thread wren ng thornton
On 2/23/12 10:22 PM, Clark Gaebel wrote: The situation I encounted this is doing a batch update of a map. Is there an easy way to do that? I'm doing something like adding 20-or-so elements to an existing map of a few thousand. The O(m+n) of the merging functions is actually on the order of the

Re: [Haskell-cafe] Data.IntMap union complexity

2012-02-25 Thread wren ng thornton
On 2/24/12 3:40 AM, Christoph Breitkopf wrote: On Fri, Feb 24, 2012 at 4:48 AM, wren ng thorntonw...@freegeek.org wrote: When the two maps are of vastly different sizes, O(min(m,n)) is a more intuitive way to think about it. Since you only have to look at the places where the spines clash,

Re: [Haskell-cafe] Data.IntMap union complexity

2012-02-25 Thread wren ng thornton
Evan Laforge qdun...@gmail.com wrote: I've wondered if it's faster to insert many keys by successive insertion, or by building another map and then unioning, and likewise with deletion. I eventually decided on successive, thinking a log n build + merge is going to be slower than a m*log n

[Haskell-cafe] ANN: stm-chans 1.3.1

2012-02-29 Thread wren ng thornton
-- stm-chans 1.3.1 The stm-chans package offers a collection of channel types, similar to Control.Concurrent.STM.TChan but with additional features. --

Re: [Haskell-cafe] Does somebody know about these functions?

2012-02-29 Thread wren ng thornton
On 2/28/12 1:25 PM, Brent Yorgey wrote: On Tue, Feb 28, 2012 at 06:06:25PM +0100, Johan Holmquist wrote: inter :: (a - a - b) - [a] - [b] inter f [] = [] inter f l = map (uncurry f) $ zip l (tail l) I've never seen this function defined anywhere, but it looks nice. I've used it a few

Re: [Haskell-cafe] Does somebody know about these functions?

2012-03-03 Thread wren ng thornton
On 2/29/12 11:42 PM, Tony Morris wrote: On 01/03/12 14:40, wren ng thornton wrote: Of course, you can simplify the implementation by: inter f xs = zipWith f xs (tail xs) inter f = zipWith f * tail Whee, golf! :) -- Live well, ~wren

Re: [Haskell-cafe] What's the term for this? Alpha-reordering? [was: Re: FreeSect -- generalised sections syntax extension

2012-03-03 Thread wren ng thornton
On 3/3/12 7:55 PM, AntC wrote: So is there an arbitrary greek letter term for reordering? I'm not aware of one, in part no doubt because it's not a semantics-preserving transformation (that is, not in the same sense as that used in defining alpha, beta, eta, delta,...). In the extension to

Re: [Haskell-cafe] What's the term for this? Alpha-reordering? [was: Re: FreeSect -- generalised sections syntax extension

2012-03-03 Thread wren ng thornton
On 3/3/12 9:15 PM, wren ng thornton wrote: In the extension to lambda calculus I presented at NASSLLI a couple years back[1] it is indeed semantics-preserving. In that context I named it chi, because it's a chiastic transformation. In combinator calculi the name of `flip` is C, which gives

Re: [Haskell-cafe] FreeSect -- generalised sections syntax extension

2012-03-04 Thread wren ng thornton
On 3/3/12 10:37 PM, Ras Far wrote: Now the serendipity with Wren's linguistic research. And even the freegeek domain. Fantastic. Wren, your slides look great, thanks for the link, I think I'll read them tonight. Do you have a paper version of the slides at all? Slides can be a bit terse on

Re: [Haskell-cafe] FreeSect -- generalised sections syntax extension

2012-03-04 Thread wren ng thornton
On 3/3/12 10:37 PM, Ras Far wrote: So we can have ... chiastic freesects? This sounds like too much fun! I find chiasmus is a term from linguistics? I'm not sure it's used much in linguistics per se, but it's common terminology from classics, rhetoric, and poetry. Literally chiastic just

Re: [Haskell-cafe] Double-dispatch

2012-03-05 Thread wren ng thornton
On 3/5/12 4:24 PM, Clark Gaebel wrote: Well look at that. Thanks! On Mon, Mar 5, 2012 at 4:07 PM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: {-# LANGUAGE MultiParamTypeClasses #-} class Intersectable a b where intersectsWith :: a - b - Bool Assuming that intersectsWith is

Re: [Haskell-cafe] [Haskell] Higher types in contexts

2012-03-05 Thread wren ng thornton
On 3/5/12 5:13 PM, AntC wrote: I've tried that ListFunc wrapping you suggest: [...] But I can't 'dig out' the H-R function and apply it (not even monomorphically): That's because the suggestion changed it from a universal quantifier to an existential quantifier. data Exists f = forall

Re: [Haskell-cafe] using mutable data structures in pure functions

2012-03-14 Thread wren ng thornton
On 3/11/12 11:52 PM, Ben Gamari wrote: That being said, there are some cases where you really do want to be able to utilize a mutable data structure inside of an otherwise pure algorithm. This is precisely the use of the ST monad. ST serves to allow the use of mutable state inside of a function

Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing

2012-03-16 Thread wren ng thornton
On 3/16/12 6:00 AM, Erik de Castro Lopo wrote: Hi all, With a base system with just ghc and cabal-install, if I try to install bytestring-lexing I get: $ cabal install bytestring-lexing Resolving dependencies... Configuring bytestring-lexing-0.4.0... cabal: The program

Re: [Haskell-cafe] Too much inlining on text package

2012-03-16 Thread wren ng thornton
On 3/16/12 12:22 PM, Aleksey Khudyakov wrote: Disclaimer. I'm no expert in text internals. Because it's told to do so. This is an unfortunate feature of stream fusion. It does eliminate intermediate data structures but it requires that everything is inlined. There are ways of mitigating

Re: [Haskell-cafe] ANN: Haskell Platform Versions Comparison Chart

2012-03-18 Thread wren ng thornton
On 3/18/12 5:08 AM, Simon Hengel wrote: Hi, I compiled a chart that gives a side-by-side comparison of package versions in various Haskell Platform releases. http://sol.github.com/haskell-platform-versions-comparison-chart/ This includes both, packages that come with ghc and platform

[Haskell-cafe] ANN: unification-fd 0.7.0

2012-03-19 Thread wren ng thornton
-- unification-fd 0.7.0 The unification-fd package offers generic functions for single-sorted first-order structural unification (think of programming in Prolog, or of the metavariables in type

Re: [Haskell-cafe] Are there arithmetic composition of functions?

2012-03-19 Thread wren ng thornton
On 3/19/12 12:57 PM, sdiy...@sjtu.edu.cn wrote: By arithmetic I mean the everyday arithmetic operations used in engineering. In signal processing for example, we write a lot of expressions like f(t)=g(t)+h(t)+g'(t) or f(t)=g(t)*h(t). I feel it would be very natural to have in haskell something

Re: [Haskell-cafe] adding the elements of two lists

2012-03-25 Thread wren ng thornton
On 3/25/12 8:06 AM, Michael Snoyman wrote: A simple solution is to use the zipWith[1] function: zipWith (+) [1,2,3] [4,5,6] == [5,7,9] It takes a bit of time to get acquainted with all of the incredibly convenient functions in base, but once you know them, it can greatly simplify your

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread wren ng thornton
On 3/26/12 8:16 AM, Jake McArthur wrote: This is interesting because it seems to be a counterexample to the claim that you can lift any Num through an Applicative (ZipList, in this case). It seems like maybe that only works in general for monoids instead of rings? I'm not so sure about that.

Re: [Haskell-cafe] Google Summer of Code - Lock-free data

2012-04-01 Thread wren ng thornton
On 3/30/12 4:27 AM, Krzysztof Skrzętnicki wrote: You mention benchmarking TChans: one particular problem with TChans and Chans is that they are unbounded. If the producers outpace consumers it soon ends with memory exhaustion. If that's the case, then you should consider TBChan[1] which is a

Re: [Haskell-cafe] Category Theory Questions

2012-04-09 Thread wren ng thornton
On 4/9/12 12:37 AM, Sergiu Ivanov wrote: I am currently studying category theory by the book Joy of Cats. Are there any people whom I could ask some questions related to category theory from time to time? Or could I just post my questions here directly? In addition to the math venues

Re: [Haskell-cafe] ANN: signed-multiset-0.1

2012-04-19 Thread wren ng thornton
On 4/19/12 7:02 PM, Richard O'Keefe wrote: For a specific example, I haven't the faintest intuition about what 'map' should do. Suppose we have {(k1)x1, (k2)x2} and f x1 == f x2 = y. Should the value of map f {...} be {(k1+k2)y} or {(k1`max`k2)y} or what? Good question. I'd suppose

Re: [Haskell-cafe] Correspondence between libraries and modules

2012-04-22 Thread wren ng thornton
On 4/22/12 6:30 PM, Alvaro Gutierrez wrote: On Sun, Apr 22, 2012 at 4:45 PM, Brandon Allberyallber...@gmail.comwrote: One reason: modules serve multiple purposes; one of these is namespacing, and in the case of interfaces to foreign libraries that may force a division that would otherwise not

Re: [Haskell-cafe] ANN: signed-multiset-0.1

2012-04-24 Thread wren ng thornton
On 4/23/12 9:18 AM, Stefan Holdermans wrote: Sjoerd, This is not just about map, but it also a problem for the Monoid instance. You are basically adding an extra identity element, 0, to the max monoid, which works but is weird. Still that's how union is typically defined for hybrid sets.

Re: [Haskell-cafe] Is protocol-buffers package maintainer reachable?

2012-04-24 Thread wren ng thornton
On 4/23/12 10:26 AM, Aleksey Khudyakov wrote: On 23.04.2012 17:01, Paul Graphov wrote: Hackage names Christopher Edward Kuklewicz as their maintainer. I've sent him patches more than a month ago but neiter they were applied nor I got any response. [...] I've too tried to contact him almost

Re: [Haskell-cafe] Correspondence between libraries and modules

2012-04-24 Thread wren ng thornton
On 4/23/12 11:39 AM, Gregg Lebovitz wrote: On 04/23/2012 12:03 AM, wren ng thornton wrote: However, until better technical support is implemented (not just for GHC, but also jhc, UHC,...) it's best to follow social practice. Wren, I am new to Haskell and not aware of all of the conventions

Re: [Haskell-cafe] Correspondence between libraries and modules

2012-04-24 Thread wren ng thornton
On 4/24/12 9:59 AM, Gregg Lebovitz wrote: The question of how to support rapid innovation and stable deployment is not an us versus them problem. It is one of staging releases. The Linux kernel is a really good example. The Linux development team innovates faster than the community can absorb

Re: [Haskell-cafe] Correspondence between libraries and modules

2012-04-24 Thread wren ng thornton
On 4/23/12 3:06 PM, Alvaro Gutierrez wrote: I see. The first thing that comes to mind is the notion of module granularity, which of course is subjective, so whether a single module or multiple ones should handle e.g. doubles and integrals is a good question; are there guidelines as to how those

Re: [Haskell-cafe] ANN: signed-multiset-0.1

2012-04-25 Thread wren ng thornton
On 4/25/12 5:39 AM, Stefan Holdermans wrote: The union of two sets is typically defined as the smallest set that is a superset of both the operands; Or, the smallest set containing all the elements of both/all operands. The two definitions coincide for sets. They diverge for bags/multisets:

Re: [Haskell-cafe] ANN: signed-multiset-0.1

2012-04-25 Thread wren ng thornton
On 4/25/12 7:27 PM, Stefan Holdermans wrote: Sjoerd, [3] defines the union as h(u) = max(f(u), g(u)) where f, g and h are multiplicity functions. Which is the same, as [3] is about multisets, not signed multisets. Chapter 3 of [3] is about Hybrid Sets. And there the union is defined by

Re: [Haskell-cafe] ANN: unfoldable-0.4.0

2012-04-27 Thread wren ng thornton
On 4/26/12 3:52 PM, Roman Cheplyaka wrote: * Tillmann Rendelren...@informatik.uni-marburg.de [2012-04-26 21:34:21+0200] Hi, Sjoerd Visscher wrote: Just as there's a Foldable class, there should also be an Unfoldable class. This package provides one: class Unfoldable t where unfold

Re: [Haskell-cafe] ANN: unfoldable-0.4.0

2012-04-29 Thread wren ng thornton
On 4/28/12 12:10 PM, Sjoerd Visscher wrote: But I don't think an unfoldable class for * types is that interesting. Any type that would be an instance could also be in instance of Bounded and Enum: In a technical sense, yes, but not necessarily in a semantic sense. Usually Bounded and Enum

Re: [Haskell-cafe] Learn you

2012-05-03 Thread wren ng thornton
On 5/3/12 1:26 AM, Richard O'Keefe wrote: The Little Lisper (and the other books like The Little Schemer and The Seasoned Schemer) are presumably meant to be funny, but to me come across as offensively patronising Tis a pity. I know the authors and they certainly didn't mean it to be

Re: [Haskell-cafe] Fixed point newtype confusion

2012-05-06 Thread wren ng thornton
On 5/6/12 8:59 AM, Sebastien Zany wrote: Hi, Suppose I have the following types: data Expr expr = Lit Nat | Add (expr, expr) newtype Fix f = Fix {unFix :: f (Fix f)} I can construct a sample term: term :: Expr (Expr (Expr expr)) term = Add (Lit 1, Add (Lit 2, Lit 3)) But isn't quite

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-06 Thread wren ng thornton
On 5/6/12 2:40 AM, Janek S. wrote: Hi, a couple of times I've encountered a statement that Haskell programs can have performance comparable to programs in C/C++. I've even read that thanks to functional nature of Haskell, compiler can reason and make guarantess about the code and use that

Re: [Haskell-cafe] Fixed point newtype confusion

2012-05-07 Thread wren ng thornton
On 5/7/12 8:55 PM, Sebastien Zany wrote: To slightly alter the question, is there a way to define a class class (Functor f) = Fixpoint f x where ... You can just do that (with MPTCs enabled). Though the usability will be much better if you use fundeps or associated types in order to

Re: [Haskell-cafe] Fixed point newtype confusion

2012-05-09 Thread wren ng thornton
On 5/8/12 8:24 PM, Sebastien Zany wrote: Hmm, I don't understand how that would work. Using one of the fundep versions: class (Functor f) = Fixpoint f x | ... where fix :: f x - x unfix :: x - f x We'd define instances like the following: data List a = Nil | Cons a

Re: [Haskell-cafe] darcs patch dependencies in dot format

2012-05-16 Thread wren ng thornton
On 5/12/12 8:52 AM, Sönke Hahn wrote: Any comments or suggestions? Cabalize it and release it on Hackage. But especially the cabalization part :) You should probably farm out the toDot rendering to one of the libraries that focuses on that[1], since they'll have focused on the efficiency

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-16 Thread wren ng thornton
On 5/10/12 8:44 PM, Ryan Newton wrote: through the trouble of writing my algorithms in C/C++, but simple-minded people often have a desire to get the best performance possible, in which case you really want to use C, C++, Fortran or whatever high level assembler language you like. I think this

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-19 Thread wren ng thornton
On 5/16/12 7:43 AM, Yves Parès wrote: On the one hand, characterizing those who desire the best performance possible as simple-minded is, at best, a gross over-generalization. Like you, I work in a field where optimization is king (e.g., in machine translation, program runtimes are measured in

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-19 Thread wren ng thornton
On 5/16/12 3:57 PM, Bardur Arantsson wrote: Comparing languages is a highly non-trivial matter involving various disciplines (including various squidgy ones) and rarely makes sense without a very specific context for comparison. Exactly. That's what I was trying to get at re the problems of

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-19 Thread wren ng thornton
On 5/18/12 7:45 AM, Roman Werpachowski wrote: On Fri, 18 May 2012 15:30:09 +1200, Richard O'Keefeo...@cs.otago.ac.nz wrote: The claim was and remains solely that THE TIME DIFFERENCE BETWEEN *ALGORITHMS* can be bigger than THE TIME DIFFERENCE BETWEEN *LANGUAGES* and is in this particular

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-19 Thread wren ng thornton
On 5/16/12 4:37 PM, Gregg Lebovitz wrote: 1) Outstanding best practices documents that capture this knowledge and provides useful answers. Organizing this information in an online document that can be searched by keyword or index would be really helpful. The hard part will be maintaining it. As

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-22 Thread wren ng thornton
On 5/21/12 10:51 AM, Yves Parès wrote: I do think we have the opposite problem, however, in much Haskell code -- people are using the clean, obviously correct, but inefficient code even in standard library functions that really should be optimized like crazy! And even before optimizing like

Re: [Haskell-cafe] Encoding issues with LDAP package

2012-05-22 Thread wren ng thornton
On 5/22/12 10:30 AM, Vincent Ambo wrote: Hej, I'm using the LDAP package by John Goerzen to retrieve some information from an Active Directory database. Part of this information are the full names of my company's employees. Many of these names contain characters which aren't part of the

Re: [Haskell-cafe] Please critique my code (a simple lexer)

2012-05-22 Thread wren ng thornton
On 5/22/12 11:13 AM, John Simon wrote: - Is `case _ of x:xs - x:xsr where xsr = something xs` a common idiom? It happened twice in my code, and it seems odd to split the first element away from the rest of the list as it's processed. I don't know how common it is in practice, but that's fmap

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-22 Thread wren ng thornton
On 5/22/12 12:54 PM, Isaac Gouy wrote: On 5/21/2012 6:54 PM, Richard O'Keefe wrote: For 50,000 nodes and 8,385,254 edges, Java (first version) ran out of memory after 89.54 seconds (default heap) Java (2nd version) 13.31 seconds -- avoid Integer boxing! Java (3rd

Re: [Haskell-cafe] Building pattern and trying monads

2012-05-27 Thread wren ng thornton
On 5/27/12 8:21 AM, L Corbijn wrote: 2. My solution with saving/reverting monad-stacks seems quite a hassle/hack, so is it a good approach or is there something better? One good solution for backtracking is to use logict[1]. I've used it with various state-like monads and it works well (e.g.,

Re: [Haskell-cafe] Confused by ghci output

2012-05-31 Thread wren ng thornton
On 5/31/12 12:48 PM, Lorenzo Bolla wrote: It looks like you are overflowing `Int` with 3^40. In your QuickCheck test, the function signature uses Int: +1. I was bitten by this issue recently as well. When playing around with properties and debugging in GHCi, always beware of type defaulting

Re: [Haskell-cafe] Most Important GHC extensions to learn/use?

2012-05-31 Thread wren ng thornton
On 5/31/12 7:15 PM, Jonathan Geddes wrote: Haskell Hackers, I'm pretty comfortable with all of Haskell 98 (and 2010, really). But I've always sort of avoided extensions. I realize that this is a bit silly and if I want to continue learning, it probably means delving into the extensions. Which

Re: [Haskell-cafe] Most Important GHC extensions to learn/use?

2012-06-01 Thread wren ng thornton
On 6/1/12 12:45 AM, Jonathan Geddes wrote: Thanks, Wren, I really appreciate the detailed response! Though I am surprised that Template Haskell isn't on your list. From the little I know of TH it seems like all of the interesting generic/generative stuff is done with TH. Do the other

Re: [Haskell-cafe] Most Important GHC extensions to learn/use?

2012-06-01 Thread wren ng thornton
On 6/1/12 6:11 AM, Gábor Lehel wrote: On Fri, Jun 1, 2012 at 6:29 AM, wren ng thorntonw...@freegeek.org wrote: TypeFamilies (aka TFs) These are really nifty and they're all the rage these days. In a formal sense they're equivalent to fundeps, but in practice

Re: [Haskell-cafe] Why does Enum succ and pred functions throw exception

2012-06-24 Thread wren ng thornton
On 6/21/12 1:15 PM, Brandon Allbery wrote: On Thu, Jun 21, 2012 at 5:11 AM, Rouan van Dalenrvda...@yahoo.co.ukwrote: Can anyone shed some light on why the succ and pred functions of the Enum typeclass throw exceptions if we go over the upper or lower boundary, and not return Maybe a? Enum

Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-06-24 Thread wren ng thornton
On 6/24/12 5:41 AM, Anton Kholomiov wrote: I think monad's methods are misleading, let's rename them class Monad m where idM :: a - m a (*$) :: (a - m b) - m a - m b We can see that `return` is a monadic identity and the `bind` is an application in disguise. So now we have two

Re: [Haskell-cafe] Combining Network Descriptions in Reactive.Banana

2012-07-10 Thread wren ng thornton
On 6/27/12 2:57 PM, Alexander Foremny wrote: Sweet! Thank you very much! Just out of curiosity: how does this differ from the following, not compiling type signature? library :: forall t. NetworkDescription t (Behavior t String) - IO () The type: (forall a. F a) - G is isomorphic to:

[Haskell-cafe] ANN: unification-fd 0.8.0

2012-07-10 Thread wren ng thornton
-- unification-fd 0.8.0 The unification-fd package offers generic functions for single-sorted first-order structural unification (think of programming in Prolog, or of the metavariables in type

Re: [Haskell-cafe] Is (==) commutative?

2012-07-29 Thread wren ng thornton
On 7/24/12 9:19 PM, Christian Sternagel wrote: Dear all, Thanks for your replies. Just to clarify: I am fully aware that inside Haskell there is no guarantee that certain (intended) requirements on type class instances are satisfied. I was asking whether the intention for Eq is that (==) is

Re: [Haskell-cafe] Is (==) commutative?

2012-07-29 Thread wren ng thornton
On 7/24/12 9:19 PM, Christian Sternagel wrote: (x == y) = True == x = y (x == y) = False == not (x = y) (x == _|_) = _|_ (_|_ == y) = _|_ Those axioms state that (==) is sound w.r.t. to meta-equality and strict in both it's arguments. An immediate problem that arises here is: what exactly

Re: [Haskell-cafe] Reddy on Referential Transparency

2012-07-29 Thread wren ng thornton
On 7/27/12 1:49 PM, Ross Paterson wrote: So a language is referentially transparent if replacing a sub-term with another with the same denotation doesn't change the overall meaning? But then isn't any language RT with a sufficiently cunning denotational semantics? Or even a dumb one that gives

Re: [Haskell-cafe] Is (==) commutative?

2012-08-02 Thread wren ng thornton
On 7/30/12 9:51 PM, Christian Sternagel wrote: Thanks Wren, for the explanations (also in your previous mail)! On 07/30/2012 01:29 PM, wren ng thornton wrote: On 7/24/12 9:19 PM, Christian Sternagel wrote: (x == y) = True == x = y (x == y) = False == not (x = y) (x == _|_) = _|_ (_|_ == y

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

2012-08-02 Thread wren ng thornton
On 7/30/12 5:35 PM, Henk-Jan van Tuyl wrote: - Block creation of usernames o ending with two or more digits o with more than one x or q o starting with buy o longer than 20 characters o with more than 4 consonants in a row As other's've mentioned, many of these constraints impose undue burden

Re: [Haskell-cafe] 3 level hierarchy of Haskell objects

2012-08-08 Thread wren ng thornton
On 8/8/12 3:36 PM, Patrick Browne wrote: On 08/08/12, *Ertugrul Söylemez *e...@ertes.de wrote: So you basically just mean class (Functor f) = Applicative f Yes, but I want to know if there is a simple mathematical relation between the classes and/or their types Let us introduce

Re: [Haskell-cafe] 3 level hierarchy of Haskell objects

2012-08-09 Thread wren ng thornton
On 8/8/12 9:41 PM, Jay Sulzberger wrote: Haskell's type classes look to me to be a provision for declaring a signature in the sense of the above article. Just to clarify this in the context of my previous post, type classes define signatures in two significantly different ways. (1) The

Re: [Haskell-cafe] 3 level hierarchy of Haskell objects

2012-08-15 Thread wren ng thornton
On 8/13/12 5:42 PM, Jay Sulzberger wrote: One difficulty which must impede many who study this stuff is that just getting off the ground seems to require a large number of definitions of objects of logically different kinds. (By logic I mean real logic, not any particular formalized system.) We

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-15 Thread wren ng thornton
On 8/13/12 9:25 PM, Jay Sulzberger wrote: I did suspect that, in some sense, constraints in combination with forall could give the quantifier exists. It's even easier than that. (forall a. P(a)) - Q = exists a. (P(a) - Q) Where P and Q are metatheoretic/schematic variables. This is

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-16 Thread wren ng thornton
On 8/15/12 12:32 PM, David Feuer wrote: On Aug 15, 2012 3:21 AM, wren ng thorntonw...@freegeek.org wrote: It's even easier than that. (forall a. P(a)) - Q = exists a. (P(a) - Q) Where P and Q are metatheoretic/schematic variables. This is just the usual thing about antecedents being in

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-16 Thread wren ng thornton
On 8/15/12 2:55 PM, Albert Y. C. Lai wrote: On 12-08-15 03:20 AM, wren ng thornton wrote: (forall a. P(a)) - Q = exists a. (P(a) - Q) For example: A. (forall p. p drinks) - (everyone drinks) B. exists p. ((p drinks) - (everyone drinks)) In a recent poll, 100% of respondents think A true, 90

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-16 Thread wren ng thornton
On 8/15/12 11:02 PM, MightyByte wrote: One tool-based way to help with this problem would be to add a flag to Cabal/cabal-install that would cause it to ignore upper bounds. I'd much rather have a distinction between hard upper bounds (known to fail with) vs soft upper bounds (tested with).

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-18 Thread wren ng thornton
On 8/17/12 12:54 AM, Alexander Solla wrote: On Thu, Aug 16, 2012 at 8:07 PM, wren ng thornton w...@freegeek.org wrote: Though bear in mind we're discussing second-order quantification here, not first-order. Can you expand on what you mean here? I don't see two kinds of quantification

Re: [Haskell-cafe] phantom types

2012-08-18 Thread wren ng thornton
On 8/17/12 5:35 AM, TP wrote: Hi, I am currently reading documentation on Generalized Algebraic Data Types: http://en.wikibooks.org/wiki/Haskell/GADT I have a question concerning this page. Let us consider the following code proposed in the page: -- -- Phantom

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-18 Thread wren ng thornton
On 8/17/12 11:28 AM, Leon Smith wrote: And the difference between reactionary and proactive approaches I think is a potential justification for the hard and soft upper bounds; perhaps we should instead call them reactionary and proactive upper bounds instead. I disagree. A hard constraint

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-23 Thread wren ng thornton
On 8/22/12 9:18 AM, Leon Smith wrote: I think we actually agree more than we disagree; I do think distinguishing hard and soft upper bounds (no matter what they are called) would help, and I'm just trying to justify them to some of the more dismissive attitudes towards the idea Hopefully.

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-23 Thread wren ng thornton
On 8/22/12 12:35 PM, David Menendez wrote: As I see it, there are four possibilities for a given version of dependency: 1. The version DOES work. The author (or some delegate) has compiled the package against this version and the resulting code is considered good. 2. The version SHOULD work. No

Re: [Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-23 Thread wren ng thornton
On 8/22/12 5:23 PM, Matthew Steele wrote: So my next question is: why does unpacking the newtype via pattern matching suddenly limit it to a single monomorphic type? Some Haskell code: foo :: (forall a. a - Int) - Bool foo fn = ... newtype IntFn a = IntFn (a - Int) bar1 ::

Re: [Haskell-cafe] model theory for type classes

2012-08-23 Thread wren ng thornton
On 8/23/12 1:02 PM, Patrick Browne wrote: I am just not sure whether there is a model expansion from the super-class model to the subclass model. If by model expansion from... you mean that there is a canonical/unique/special mapping from every superclass model to some subclass model, then

Re: [Haskell-cafe] When is a composition of catamorphisms a catamorphism?

2012-08-25 Thread wren ng thornton
On 8/24/12 3:44 AM, Sebastien Zany wrote: More specifically (assuming I understood the statement correctly): Suppose I have two base functors F1 and F2 and folds for each: fold1 :: (F1 a - a) - (μF1 - a) and fold2 :: (F2 a - a) - (μF2 - a). Now suppose I have two algebras f :: F1 μF2 - μF2 and

Re: [Haskell-cafe] When is a composition of catamorphisms a catamorphism?

2012-08-27 Thread wren ng thornton
On 8/26/12 9:10 PM, Sebastien Zany wrote: Thanks Wren. That was my guess too, but it seems not necessary: http://stackoverflow.com/questions/12103309/when-is-a-composition-of-catamorphisms-a-catamorphism Well, sure. I was meaning in the general case. If you have the right kind of

Re: [Haskell-cafe] Cabal install fails due to recent HUnit

2012-08-27 Thread wren ng thornton
On 8/27/12 6:27 PM, Tristan Seligmann wrote: On Aug 27, 2012 8:40 PM, Erik Hesselink hessel...@gmail.com wrote: The other question is how useful test suites in a released package are. Aren't they much more useful (and used more often) in source repositories? Having tests available in a

<    4   5   6   7   8   9   10   >