Re: [Haskell-cafe] Layered maps

2010-10-09 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

Re: [Haskell-cafe] Ordering vs. Order

2010-10-09 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

Re: [Haskell-cafe] Ordering vs. Order

2010-10-09 Thread Jeff Wheeler
On Thu, Oct 7, 2010 at 8:29 AM, Steve Schafer st...@fenestra.com 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

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

2010-10-09 Thread Vincent Hanquez
On Fri, Oct 08, 2010 at 12:54:48PM +0100, Sittampalam, Ganesh wrote: What's the motivation for this? Well, I wanted to have a tls/ssl module that integrate nicely with haskell. until then the 2 solutions were: - shelling out to curl: that's not great, usually works until you have an error, and

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

2010-10-09 Thread Vincent Hanquez
On Fri, Oct 08, 2010 at 02:08:29PM +0200, Christopher Done wrote: Indeed. Easier to install, easier to hack on (for Haskellers). Haskell program coverage, debugging, extending your quickcheck tests, etc. absolutely. I'm certainly hoping to quickcheck all that is quickcheckable. The next thing

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

2010-10-09 Thread Vincent Hanquez
On Fri, Oct 08, 2010 at 12:59:56PM +0100, Maciej Piechotka wrote: 1. Could also callback in addition to handles be added? Like: connect' :: (ByteString - IO ()) - IO ByteString - TLSClient IO () Would an interface that generate the packet to send and just return them as bytes be even better

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

2010-10-09 Thread Heinrich Apfelmus
Gregory Crosswhite wrote: Could you explain to me why HXT uses arrows? I have never been able to figure out what advantage this gives your library over monads. Since your arrows in practice implement ArrowApply, they are really just monads anyway, so it seems to me that using arrows instead

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

2010-10-09 Thread Daniel Fischer
On Saturday 09 October 2010 06:34:32, Lennart Augustsson wrote: 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 Well, in light of -- We

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Kevin Jardine
Hi Oleg, Thank you for this wonderful detailed solution! I was attempting to turn this into a small library and wanted to avoid exporting unwrap. I defined: polyToMonoid' = unwrap . polyToMonoid and then GHC told me: No instance for (PolyVariadic a (WMonoid m)) arising from a use of

Re: [Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Bartek Ćwikłowski
Hello Kevin, 2010/10/9 Kevin Jardine kevinjard...@gmail.com: I was attempting to turn this into a small library and wanted to avoid exporting unwrap. I defined: polyToMonoid' = unwrap . polyToMonoid If you disable MonomorphismRestriction this definition typechecks just fine. Alternatively,

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

2010-10-09 Thread Maciej Piechotka
On Sat, 2010-10-09 at 09:27 +0100, Vincent Hanquez wrote: On Fri, Oct 08, 2010 at 12:59:56PM +0100, Maciej Piechotka wrote: 1. Could also callback in addition to handles be added? Like: connect' :: (ByteString - IO ()) - IO ByteString - TLSClient IO () Would an interface that

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Kevin Jardine
Hi Bartek, Yes, it compiles, but when I try to use polyToMonoid', it turns out that this function is no longer polyvariadic, unlike the original polyToMonoid . This may be what Luke meant when he wrote you lose composability. Even with the extra unwrap function I think that this is pretty cool,

[Haskell-cafe] Make your Darcs repositories hashed?

2010-10-09 Thread Christopher Done
Every Darcs repository I've pulled this year has always showed me this message: *** Fetching a hashed repository would be faster. Perhaps you could persuade the maintainer to run darcs optimize --upgrade with darcs 2.4.0

Re: [Haskell-cafe] Make your Darcs repositories hashed?

2010-10-09 Thread Roel van Dijk
The darcs installed on code.haskell.org is still version 2.02. It doesn't know about 'optimize --upgrade'. How do I upgrade those repositories? On Sat, Oct 9, 2010 at 2:30 PM, Christopher Done chrisd...@googlemail.com wrote: Every Darcs repository I've pulled this year has always showed me this

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Kevin Jardine
Oleg, Another puzzle is that: instance Show a = Monoidable a String where toMonoid a = show a main = putStrLn $ unwrap $ polyToMonoid True () (Just (5::Int)) works just fine, but instance Show a = Monoidable a [String] where toMonoid a = [show a] main = putStrLn $ unwrap $

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Kevin Jardine
Another example that also fails to compile (but I cannot see why): import Data.PolyToMonoid import Data.Monoid instance Monoid Int where mappend = (+) mempty = 0 instance Monoidable Int Int where toMonoid = id main = putStrLn $ show $ unwrap $ polyToMonoid (0::Int) (1::Int)

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

2010-10-09 Thread Florian Weimer
* Donn Cave: Quoth Florian Weimer f...@deneb.enyo.de, 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

Re: [Haskell-cafe] Layered maps

2010-10-09 Thread Jake McArthur
What you describe sounds like a perfect job for a trie, so that's what I think you should look into. - Jake ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2010-10-09 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/9/10 09:17 , Malcolm Wallace wrote: On 8 Oct 2010, at 16:56, Donn Cave wrote: wikipedia: Managed code is a differentiation coined by Microsoft to identify computer program code that requires and will only execute under the

[Haskell-cafe] Re-order type

2010-10-09 Thread André Batista Martins
Hello, exists any algorithm to determine how terms can be changed to safisty the type of one function? example: f:: a- b - c - (b,c,a) f1 :: c - a - d In my first function f i want assign the output c and a for to input of function f1. I searched for any solution, but i didn't find any

Re: [Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/9/10 10:25 , Kevin Jardine wrote: instance Show a = Monoidable a [String] where toMonoid a = [show a] main = putStrLn $ unwrap $ polyToMonoid [] True () (Just (5::Int)) fails to compile. Why would that be? My understanding is that

Re: [Haskell-cafe] Re-order type

2010-10-09 Thread Edward Z. Yang
Excerpts from André Batista Martins's message of Sat Oct 09 17:45:05 -0400 2010: Hello, exists any algorithm to determine how terms can be changed to safisty the type of one function? Your terminology is a little off: in particular, your example doesn't include any terms (which are

Re: [Haskell-cafe] Make your Darcs repositories hashed?

2010-10-09 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/9/10 08:30 , Christopher Done wrote: Every Darcs repository I've pulled this year has always showed me this message: *** Fetching a hashed repository would be

Re: [Haskell-cafe] Make your Darcs repositories hashed?

2010-10-09 Thread Jason Dagit
On Sat, Oct 9, 2010 at 3:06 PM, Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/9/10 08:30 , Christopher Done wrote: Every Darcs repository I've pulled this year has always showed me this message:

[Haskell-cafe] Re: Re-order type

2010-10-09 Thread André Batista Martins
Might have not been clear, but i will try illustrate . f:: a- b - c - (b,(c,a)) f1 :: c - a - d input type: A B C -- |f | | _ | output

Re: [Haskell-cafe] Re: Re-order type

2010-10-09 Thread Alexander Solla
On Oct 9, 2010, at 4:17 PM, André Batista Martins wrote: If i want compose f and f1, i need to do a correct input to f1 from the output of f. So i want one function to convert the output of f to input off f!. In this case, we do f1 fst (snd (t,(t1,t2))) snd (snd (t, (t1,t2)))

Re: [Haskell-cafe] [Off-topic]Functional parsing theory

2010-10-09 Thread Maurício Antunes
After reading your message I found Why Attribute Grammars Matter and a few other introductions, and it seems attribute grammars are exactly what I'm trying to do. Do you know of some place (mailing list etc.) where I can discuss attribute grammars or ask for suggestions on design? Thanks,

Re: [Haskell-cafe] Layered maps

2010-10-09 Thread Alex Rozenshteyn
Hmm. It seems that both the trie packages I found just provide a standard map-like interface, without exposing their trie-ness. Makes sense, but limits usefulness for me. Thanks. On Sat, Oct 9, 2010 at 3:08 PM, Jake McArthur jake.mcart...@gmail.comwrote: What you describe sounds like a

Re: [Haskell-cafe] Make your Darcs repositories hashed?

2010-10-09 Thread Brent Yorgey
On Sat, Oct 09, 2010 at 03:43:42PM -0700, Jason Dagit wrote: The Haskell.org server doesn't have to be upgraded. Maintainers can install a newer darcs locally (cabal install darcs), do the upgrade locally and then copy the repository back to the haskell.org server. Really? But then the

Re: [Haskell-cafe] Make your Darcs repositories hashed?

2010-10-09 Thread Jason Dagit
On Sat, Oct 9, 2010 at 8:52 PM, Brent Yorgey byor...@seas.upenn.edu wrote: On Sat, Oct 09, 2010 at 03:43:42PM -0700, Jason Dagit wrote: The Haskell.org server doesn't have to be upgraded. Maintainers can install a newer darcs locally (cabal install darcs), do the upgrade locally and then

Re: [Haskell-cafe] Make your Darcs repositories hashed?

2010-10-09 Thread Jason Dagit
On Sat, Oct 9, 2010 at 8:52 PM, Brent Yorgey byor...@seas.upenn.edu wrote: On Sat, Oct 09, 2010 at 03:43:42PM -0700, Jason Dagit wrote: The Haskell.org server doesn't have to be upgraded. Maintainers can install a newer darcs locally (cabal install darcs), do the upgrade locally and then