Re: [Haskell-cafe] Ordering vs. Order

2010-10-08 Thread Jeff Wheeler
On Thu, Oct 7, 2010 at 8:29 AM, Steve Schafer wrote: > I think the reason for this conceptual distinction can be traced to the > derivation of "ordering" as the gerund form of the verb "order," in that > it implies that an action has occurred (or is still occurring). Reading the original message

Re: [Haskell-cafe] Ordering vs. Order

2010-10-08 Thread Alexander Solla
On Oct 7, 2010, at 1:15 AM, Alexander Solla wrote: For example, a set with three elements can be ordered in three different ways. Six ways. I hate making such basic math mistakes. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.h

Re: [Haskell-cafe] Layered maps

2010-10-08 Thread Alex Rozenshteyn
This came up as I was doing homework for natural language processing. I'm constructing a trigram model from training data, but I also need the bigram and unigram counts. I could, for each triple of characters, add the 3 tuple to a trigram map and increment its count (I know I'm not actually mutat

Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-08 Thread Lennart Augustsson
That code is incorrect. You can't assume that the base for floating point numbers is 2, that's something you have to check. (POWER6 and z9 has hardware support for base 10 floating point.) -- Lennart On Fri, Oct 8, 2010 at 2:08 PM, Daniel Fischer wrote: > The methods of the RealFrac class pro

[Haskell-cafe] pointers for EDSL design

2010-10-08 Thread oleg
John Lato wrote: > So here's a very simple expression: > > t1 = let v = sigGen (cnst 1) in outs v v > > which is what led to my question. I'm binding the sigGen to 'v' to > introduce sharing at the meta-level. Would it be better to introduce > support for this in the dsl? Often this is not a q

Re: [Haskell-cafe] Layered maps

2010-10-08 Thread wren ng thornton
On 10/8/10 5:46 PM, Thomas DuBuisson wrote: Alex, The containers library can do this already - there are no constraints on the elements of a Map. For example: type TripleNestedMap a = Map Int (Map Char (Map String a)) But this is rather silly as you can just do: type MapOfTriples a = Map

[Haskell-cafe] Polyvariadic functions operating with a monoid

2010-10-08 Thread oleg
Kevin Jardine wrote: > instead of passing around lists of values with these related types, I > created a polyvariadic function polyToString... > I finally figured out how to do this, but it was a bit harder to > figure this out than I expected, and I was wondering if it might be > possible to crea

Re: [Haskell-cafe] Ordering vs. Order

2010-10-08 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/7/10 04:02 , Christian Sternagel wrote: > However, I do know that there are many publications about "ordered > structures" which use the word "ordering" (most of which I'm aware of, not > by native speakers). Like most things in Haskell, it's na

Re: [Haskell-cafe] Ordering vs. Order

2010-10-08 Thread wren ng thornton
On 10/7/10 8:35 AM, Ketil Malde wrote: Christian Sternagel writes: recently I was wondering about the two words "order" and "ordering" I would use "ordering" to mean the relation or function that orders (ranks) elements, and I'd use "order" to refer the actual progression. So by applying an o

Re: [Haskell-cafe] Layered maps

2010-10-08 Thread Jake McArthur
On 10/08/2010 04:23 PM, Alex Rozenshteyn wrote: Does there exist a library which allows me to have maps whose elements are maps whose elements ... with a convenient syntax. It sounds like you might be looking for a trie of some sort. Would something like the TrieMap package suit your needs? It

Re: [Haskell-cafe] Re: Bulletproof resource management

2010-10-08 Thread Brandon Moore
On Oct 8, 2010, at 2:18 PM, Florian Weimer wrote: * Ben Franksen: You might be interested in Lightweight Monadic Regions http://okmij.org/ftp/Haskell/regions.html#light-weight which solve the problem (IMHO) in a much cleaner way, i.e. w/o explicit closing and also w/o using finalizers. Is

[Haskell-cafe] Re: Haskell Helper

2010-10-08 Thread c8h10n4o2
I was able to parse function definition, but function call still is a problem, -- View this message in context: http://haskell.1045720.n5.nabble.com/Haskell-Helper-tp3093854p3205482.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

[Haskell-cafe] Re: [Haskelldb-users] ANNOUNCE: HaskellDB 2.0: Scrap your SQL strings

2010-10-08 Thread Bas van Dijk
Great work! I think I'm going to use it. Any plan on packaging up Christopher Done's HaskellDB's type operators: http://chrisdone.com/posts/2010-10-07-haskelldb-and-typeoperator-madness.html Which allows you to write something like: type PersonTable = Table :$: Expr :%: Id::: Integer

[Haskell-cafe] Re: Layered maps

2010-10-08 Thread Ben Franksen
Thomas DuBuisson wrote: > On Fri, Oct 8, 2010 at 2:23 PM, Alex Rozenshteyn > wrote: >> Does there exist a library which allows me to have maps whose elements >> are maps whose elements ... with a convenient syntax. > The containers library can do this already - there are no constraints > on the el

Re: [Haskell-cafe] Layered maps

2010-10-08 Thread Thomas DuBuisson
Alex, The containers library can do this already - there are no constraints on the elements of a Map. For example: > type TripleNestedMap a = Map Int (Map Char (Map String a)) But this is rather silly as you can just do: > type MapOfTriples a = Map (Int ,Char, String) a for most uses. Cheers

[Haskell-cafe] Layered maps

2010-10-08 Thread Alex Rozenshteyn
Does there exist a library which allows me to have maps whose elements are maps whose elements ... with a convenient syntax. Alternatively, does there exist a library like Data.Tree where forests are sets rather than lists? -- Alex R ___ Hask

[Haskell-cafe] Re: Re: Bulletproof resource management

2010-10-08 Thread Ben Franksen
Florian Weimer wrote: > * Ben Franksen: >> You might be interested in Lightweight Monadic Regions >> >> http://okmij.org/ftp/Haskell/regions.html#light-weight >> >> which solve the problem (IMHO) in a much cleaner way, i.e. w/o explicit >> closing and also w/o using finalizers. > > Is this app

Re: [Haskell-cafe] Re: Bulletproof resource management

2010-10-08 Thread Florian Weimer
* Ben Franksen: > You might be interested in Lightweight Monadic Regions > > http://okmij.org/ftp/Haskell/regions.html#light-weight > > which solve the problem (IMHO) in a much cleaner way, i.e. w/o explicit > closing and also w/o using finalizers. Is this approach composeable in the sense th

[Haskell-cafe] Re: Bulletproof resource management

2010-10-08 Thread Ben Franksen
Florian Weimer wrote: > At least in my experience, in order to get proper resource management > for things like file or database handles, you need both a close > operation and a finalizer registered with the garbage collector. The > former is needed so that you can create resources faster than the

Re: [Haskell-cafe] Associated data types and contexts

2010-10-08 Thread Ryan Ingram
"D x", for an x that is not an instance of C, is still inhabited by "undefined". Additionally, on the implementation side, the dictionary C is not included inside of a D, so you still need to pass it in to call m; a function > test :: C a => D a -> Bool gets translated in Core into a system F type

Re: [Haskell-cafe] Re: Eta-expansion destroys memoization?

2010-10-08 Thread Max Bolingbroke
On 8 October 2010 10:54, Simon Marlow wrote: > We could make GHC respect the report, but we'd have to use > >  (e op)  ==>  let z = e in \x -> z op x > > to retain sharing without relying on full laziness. > > This might be a good idea in fact - all other things being equal, having > lambdas be mo

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Donn Cave
Quoth Florian Weimer , >> wikipedia: "Managed code is a differentiation coined by Microsoft to >> identify computer program code that requires and will only execute >> under the "management" of a Common Language Runtime virtual machine >> (resulting in Bytecode)." > > I like this term

Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

2010-10-08 Thread Henning Thielemann
On Thu, 7 Oct 2010, Uwe Schmidt wrote: HXT has grown over the years. Components for XPath, XSLT, validation with RelaxNG, picklers for conversion from/to native Haskell data, lazy parsing with tagsoup, input via curl and native Haskell HTTP and others have been added. This has led to a rather l

[Haskell-cafe] Reminder: BelHac: A Hackathon in Belgium, 5-7 November

2010-10-08 Thread Jasper Van der Jeugt
Hello all, We would like to remind you of BelHac, an international Hackathon taking place in Ghent, Belgium next month. All details are available on this wiki page [1]. You can register here [2]. WHEN Friday November 5: 2pm - 7pm Saturday November 6: 10am - 6pm Sunday November 7: 10am - 6pm WH

Re: [Haskell-cafe] Bulletproof resource management

2010-10-08 Thread Jason Dagit
On Fri, Oct 8, 2010 at 9:39 AM, Florian Weimer wrote: > At least in my experience, in order to get proper resource management > for things like file or database handles, you need both a close > operation and a finalizer registered with the garbage collector.  The > former is needed so that you can

Re: [Haskell-cafe] Bulletproof resource management

2010-10-08 Thread Henning Thielemann
On Fri, 8 Oct 2010, Florian Weimer wrote: At least in my experience, in order to get proper resource management for things like file or database handles, you need both a close operation and a finalizer registered with the garbage collector. The former is needed so that you can create resources

[Haskell-cafe] Bulletproof resource management

2010-10-08 Thread Florian Weimer
At least in my experience, in order to get proper resource management for things like file or database handles, you need both a close operation and a finalizer registered with the garbage collector. The former is needed so that you can create resources faster than the garbage collector freeing the

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Florian Weimer
* Donn Cave: > wikipedia: "Managed code is a differentiation coined by Microsoft to > identify computer program code that requires and will only execute > under the "management" of a Common Language Runtime virtual machine > (resulting in Bytecode)." I like this term, I apply it by e

Re: [Haskell-cafe] Re: Re: Lambda-case / lambda-if

2010-10-08 Thread Jonathan Geddes
I can honestly say that I haven't felt much pain from the status quo regarding this. Most of the time my code is structured so that case statements don't appear in do blocks. When they do, I don't see it as a big issue. The special case for operator - is a bigger wart on haskell syntax than this, i

[Haskell-cafe] ANNOUNCE: HaskellDB 2.0: Scrap your SQL strings

2010-10-08 Thread Justin Bailey
What is it? The HaskellDB library lets you generate SQL queries without writing any actual SQL. Unlike other query generating libraries, you choose the abstraction level. Queries can be built out of independent fragments, just like your programs. Leave hand-written, string-based, SQL libr

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Donn Cave
Quoth Bas van Dijk , > On Fri, Oct 8, 2010 at 3:36 PM, Florian Weimer wrote: ... >> I can see how this terminology makes sense, but it's the opposite of >> the usage in Java (where "native" == "unmanaged code called via JNI"). > > I guess it depends on the context. If the context is a C program th

[Haskell-cafe] How to make cabal pass flags to happy?

2010-10-08 Thread Niklas Broberg
Hi all, I want to do something I thought would be quite simple, but try as I might I can't find neither information nor examples on how to achieve it. What I want specifically is to have happy produce a GLR parser from my .ly file, and I want this to happen during 'cabal install'. Which in turn m

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Bas van Dijk
On Fri, Oct 8, 2010 at 3:36 PM, Florian Weimer wrote: > * Vincent Hanquez: > >> Native means the implementation is in haskell, and the library is >> not using another implementation (in another language) to do the >> work: either through FFI as a binding, or as a wrapper to an >> external program.

Re: [Haskell-cafe] I'm still having challenges to get a Haskell GUI to work under Windows 7

2010-10-08 Thread Andrew Butterfield
The windows binaries built using GHC 10.6.4 and wxHaskell 0.11.1.2 on either Win XP or Win 7 work on WIn 7 just fine, except for the font dialog box, which does nothing. This dialog box was a bit flaky on WInXP in any case. I installed 10.6.4 above on WIndows 7 using the binary installer, even

[Haskell-cafe] Re: Re: Lambda-case / lambda-if

2010-10-08 Thread Peter Wortmann
On Fri, 2010-10-08 at 01:13 +0300, Lauri Alanko wrote: > Your "general" rule doesn't subsume your case example, since a case > expression is not an application. I think you mean something like > > do C[(<- m)] > => > m >>= \tmp -> C[tmp] > > where C is an arbitrary expression context. It coul

[Haskell-cafe] Re: Desired behaviour of rounding etc.

2010-10-08 Thread Henning Thielemann
Daniel Fischer schrieb: > The methods of the RealFrac class produce garbage when the value lies > outside the range of the target type, e.g. > > Prelude GHC.Float> truncate 1.234e11 :: Int -- 32-bits > -1154051584 > > and, in the case of truncate, different garbage when the rewrite rule > fire

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Florian Weimer
* Vincent Hanquez: > Native means the implementation is in haskell, and the library is > not using another implementation (in another language) to do the > work: either through FFI as a binding, or as a wrapper to an > external program. I can see how this terminology makes sense, but it's the opp

[Haskell-cafe] Re: Desired behaviour of rounding etc.

2010-10-08 Thread Daniel Fischer
On Friday 08 October 2010 14:08:01, Daniel Fischer wrote: > On a related note, in my benchmarks, > > truncFloatGen :: Integral a => Float -> a > truncFloatGen = fromInteger . truncFloatInteger > > truncFloatInteger :: Float -> Integer > truncFloatInteger x = >   case decodeFloat x of >     (m,e) |

Re: [Haskell-cafe] Re: ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Maciej Piechotka
On Fri, 2010-10-08 at 15:14 +0200, Michael Snoyman wrote: > On Fri, Oct 8, 2010 at 1:59 PM, Maciej Piechotka > wrote: > > On Wed, 2010-10-06 at 22:26 +0100, Vincent Hanquez wrote: > >> Hi haskellers, > >> > >> I'ld like to announce the tls package [1][2], which is a native > >> implementation >

Re: [Haskell-cafe] Re: ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Michael Snoyman
On Fri, Oct 8, 2010 at 1:59 PM, Maciej Piechotka wrote: > On Wed, 2010-10-06 at 22:26 +0100, Vincent Hanquez wrote: >> Hi haskellers, >> >> I'ld like to announce the tls package [1][2], which is a native >> implementation >> of the TLS protocol, client and server.  It's currently mostly supportin

Re: [Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-08 Thread Nicolas Pouillard
On Fri, 8 Oct 2010 01:13:20 +0300, Lauri Alanko wrote: > On Thu, Oct 07, 2010 at 02:45:58PM -0700, Nicolas Pouillard wrote: > > On Thu, 07 Oct 2010 18:03:48 +0100, Peter Wortmann > > wrote: > > > Might be off-topic here, but I have wondered for a while why Haskell > > > doesn't support something

Re: [Haskell-cafe] Pronouncing "Curry" and "currying"

2010-10-08 Thread Steve Schafer
On Fri, 8 Oct 2010 09:56:07 +0200, you wrote: >Unfortunately, "hurry" is pronounced differently in British and US >English [1], so again I was a little bit confused :-). >[1] http://en.wiktionary.org/wiki/hurry#Pronunciation The US sample is correct for someone from California, but it's not the

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocolimplementation

2010-10-08 Thread Christopher Done
On 8 October 2010 13:54, Sittampalam, Ganesh wrote: > Vincent Hanquez wrote: >> On Fri, Oct 08, 2010 at 11:14:01AM +0530, C K Kashyap wrote: >>> Does native mean "Haskell only" - without FFI? >> >> Native means the implementation is in haskell, and the library is not >> using another implementatio

[Haskell-cafe] Desired behaviour of rounding etc.

2010-10-08 Thread Daniel Fischer
The methods of the RealFrac class produce garbage when the value lies outside the range of the target type, e.g. Prelude GHC.Float> truncate 1.234e11 :: Int -- 32-bits -1154051584 and, in the case of truncate, different garbage when the rewrite rule fires: Prelude GHC.Float> double2Int 1.234e

[Haskell-cafe] Re: ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Maciej Piechotka
On Wed, 2010-10-06 at 22:26 +0100, Vincent Hanquez wrote: > Hi haskellers, > > I'ld like to announce the tls package [1][2], which is a native implementation > of the TLS protocol, client and server. It's currently mostly supporting > SSL3, > TLS1.0 and TLS1.1. It's got *lots* of rough edges, a

[Haskell-cafe] Associated data types and contexts

2010-10-08 Thread Eric Walkingshaw
The following code compiles happily in GHC: > {-# LANGUAGE TypeFamilies #-} > > class C a where > data D a > m :: D a -> Bool > > test :: C a => D a -> Bool > test = m My question is why do I need the context in the function "test"? It seems like since "D" is associated with class "C", the c

RE: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocolimplementation

2010-10-08 Thread Sittampalam, Ganesh
Vincent Hanquez wrote: > On Fri, Oct 08, 2010 at 11:14:01AM +0530, C K Kashyap wrote: >> Does native mean "Haskell only" - without FFI? > > Native means the implementation is in haskell, and the library is not > using another implementation (in another language) to do the work: > either through FF

Re: [Haskell-cafe] Pronouncing "Curry" and "currying"

2010-10-08 Thread Ben Millwood
On Fri, Oct 8, 2010 at 8:56 AM, Petr Pudlak wrote: > thanks for both the explanation (Donn) and the sound sample (Luke). > Unfortunately, "hurry" is pronounced differently in British and US English > [1], so again I was a little bit confused :-). But Luke's sound sample made > it clear for me. >

[Haskell-cafe] Re: Eta-expansion destroys memoization?

2010-10-08 Thread Simon Marlow
On 07/10/2010 14:03, Derek Elkins wrote: On Thu, Oct 7, 2010 at 8:44 AM, Luke Palmer wrote: On Thu, Oct 7, 2010 at 6:17 AM, Brent Yorgey wrote: The source code seems to be easy to read, but I don't think I understand that. For me I think if I change the first line from fib = ((map fib' [0 ..

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Vincent Hanquez
On Fri, Oct 08, 2010 at 08:47:39AM +0200, Michael Snoyman wrote: > By the way, a native zlib implementation would definitely go on my > wishlist. Any takers? ;) Me too ! that's the only thing that prevented me from adding the compression layer to TLS. as such it's on my todo list, but really reall

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Vincent Hanquez
On Fri, Oct 08, 2010 at 11:14:01AM +0530, C K Kashyap wrote: > Does native mean "Haskell only" - without FFI? Native means the implementation is in haskell, and the library is not using another implementation (in another language) to do the work: either through FFI as a binding, or as a wrapper to

Re: [Haskell-cafe] I'm still having challenges to get a Haskell GUI to work under Windows 7

2010-10-08 Thread Andrew Butterfield
On 07/10/2010 19:58, cas...@istar.ca wrote: I'm still having challenges to get a Haskell GUI to work under Windows 7; even after various instructions on the web. e.g. Haskell Platform 2010.2.0.0, wxWidgets-2.9.1, wxHaskell 0.12.1.6 I have seen wxHaskell work on WIndows 7, using the same config

Re: [Haskell-cafe] Pronouncing "Curry" and "currying"

2010-10-08 Thread Petr Pudlak
Hi, thanks for both the explanation (Donn) and the sound sample (Luke). Unfortunately, "hurry" is pronounced differently in British and US English [1], so again I was a little bit confused :-). But Luke's sound sample made it clear for me. [1] http://en.wiktionary.org/wiki/hurry#Pronunciatio