[Haskell-cafe] Detecting numeric overflows

2012-07-30 Thread Евгений Пермяков
Can someone tell me if there are any primitives, that used to detect machine type overflows, in ghc haskell ? I perfectly understand, that I can build something based on preconditioning of variables, but this will kill any performance, if needed.

Re: [Haskell-cafe] GHC rendering of non-ASCII characters configurable?

2012-07-30 Thread Paolo Capriotti
On Sun, Jul 29, 2012 at 7:04 PM, Richard Cobbe co...@ccs.neu.edu wrote: I'm working on an application that involves processing a lot of Unicode data, and I'm finding the built-in Show implementation for Char to be really inconvenient. Specifically, it renders all characters at U+0080 and

Re: [Haskell-cafe] Capturing the parent element as I parse XML using parsec

2012-07-30 Thread C K Kashyap
Thank you Richard and Antoine. I think I see the pointlessness of my ask. Regards, Kashyap On Mon, Jul 30, 2012 at 4:14 AM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 29/07/2012, at 6:21 PM, C K Kashyap wrote: I am struggling with an idea though - How can I capture the parent element

Re: [Haskell-cafe] Current state of garbage collection in Haskell

2012-07-30 Thread C K Kashyap
Thank you so much Alexander and Thomas. Regards, Kashyap On Sun, Jul 29, 2012 at 11:59 PM, Thomas Schilling nomin...@googlemail.comwrote: GHC does not provide any form of real-time guarantees (and support for them is not planned). That said, it's not as bad as it sounds: - Collecting the

Re: [Haskell-cafe] GHC rendering of non-ASCII characters configurable?

2012-07-30 Thread Max Rabkin
On Sun, Jul 29, 2012 at 8:04 PM, Richard Cobbe co...@ccs.neu.edu wrote: This is annoying because all of the Unicode charts give the code points in hex, and indeed the charts are split into different PDFs at numbers that are nice and round in hex but not in decimal. So in order to figure out

Re: [Haskell-cafe] Logging pure code

2012-07-30 Thread Johan Brinch
On Mon, Jul 30, 2012 at 1:54 AM, Thomas Schilling nomin...@googlemail.com wrote: On 27 July 2012 14:52, Marco Túlio Gontijo e Silva marcotmar...@gmail.com wrote: thread blocked indefinitely in an MVar operation IIRC, that means that a thread is blocked on an MVar and the MVar is only

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

2012-07-30 Thread Niklas Broberg
On Wed, Jul 25, 2012 at 12:22 PM, Ross Paterson r...@soi.city.ac.uk wrote: As I understand it, the plan is to modify the following packages in hackage in-situ to remove the test sections (which contain the troublesome conditionals): HUnit-1.2.5.0 bloomfilter-1.2.6.10 codemonitor-0.1

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

2012-07-30 Thread Ross Paterson
On Mon, Jul 30, 2012 at 01:46:24PM +0100, Niklas Broberg wrote: On Wed, Jul 25, 2012 at 12:22 PM, Ross Paterson r...@soi.city.ac.uk wrote: As I understand it, the plan is to modify the following packages in hackage in-situ to remove the test sections (which contain the troublesome

Re: [Haskell-cafe] GHC rendering of non-ASCII characters configurable?

2012-07-30 Thread Ivan Lazar Miljenovic
On 30 July 2012 04:04, Richard Cobbe co...@ccs.neu.edu wrote: I'm working on an application that involves processing a lot of Unicode data, and I'm finding the built-in Show implementation for Char to be really inconvenient. Specifically, it renders all characters at U+0080 and above with

Re: [Haskell-cafe] AI - machine learning

2012-07-30 Thread Chris Taylor
miro miroslav.karpis at gmail.com writes: Hi All, recently I started to take a look at haskell, especially at AI. I can see some email addresses of interested people there but not so much of other activity behind. Does it exist some mailing group especially for AI?

Re: [Haskell-cafe] AI - machine learning

2012-07-30 Thread Mihai Maruseac
On Mon, Jul 30, 2012 at 4:39 PM, Chris Taylor crntay...@gmail.com wrote: miro miroslav.karpis at gmail.com writes: Hi All, recently I started to take a look at haskell, especially at AI. I can see some email addresses of interested people there but not so much of other

[Haskell-cafe] Polyvariadic composition

2012-07-30 Thread Artyom Kazak
Hello, I have accidentally written my version of polyvariadic composition combinator, `mcomp`. It differs from Oleg’s version ( http://okmij.org/ftp/Haskell/polyvariadic.html#polyvar-comp ) in three aspects: a) it is simpler, b) it works without enumerating basic cases (all existing

Re: [Haskell-cafe] Detecting numeric overflows

2012-07-30 Thread Artyom Kazak
Евгений Пермяков permea...@gmail.com писал в своём письме Mon, 30 Jul 2012 09:47:48 +0300: Can someone tell me if there are any primitives, that used to detect machine type overflows, in ghc haskell ? I perfectly understand, that I can build something based on preconditioning of variables,

Re: [Haskell-cafe] Polyvariadic composition

2012-07-30 Thread MigMit
Works here. GHC 7.4.2 On Jul 30, 2012, at 11:32 PM, Artyom Kazak artyom.ka...@gmail.com wrote: Hello, I have accidentally written my version of polyvariadic composition combinator, `mcomp`. It differs from Oleg’s version ( http://okmij.org/ftp/Haskell/polyvariadic.html#polyvar-comp ) in

Re: [Haskell-cafe] Detecting numeric overflows

2012-07-30 Thread Евгений Пермяков
On 07/31/2012 12:04 AM, Artyom Kazak wrote: Евгений Пермяков permea...@gmail.com писал в своём письме Mon, 30 Jul 2012 09:47:48 +0300: Can someone tell me if there are any primitives, that used to detect machine type overflows, in ghc haskell ? I perfectly understand, that I can build

Re: [Haskell-cafe] why does a foldr not have a space leak effect?

2012-07-30 Thread Ryan Ingram
The difference is that foldl *must* produce the entire list of thunks, even if f is lazy in its first argument. There's no foldl that can perform better given a sufficiently-lazy f; given head = foldr go fail where go x y = x fail = error head: empty list head [a,b,c,d] = foldr go fail

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

2012-07-30 Thread Henk-Jan van Tuyl
On Mon, 16 Jul 2012 00:03:49 +0200, Henk-Jan van Tuyl hjgt...@chello.nl wrote: I am willing to do administrator tasks. 4. ReCAPTCHA enabled for 'edits adding new, unrecognized external links' - which is all of the spam. This is already enabled. The HaskellWiki is still flooded with

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

2012-07-30 Thread timothyhobbs
Can we have at least 5 consonants?  There are enough people with names such as Srbský in eastern European  In fact, the Czechs can make use of as many as 9 consonants in a row!  http://ld.johanesville.net/perlicky/03- jazykova-nej-a-jine-hricky On a side note, image based CAPACHA's can

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

2012-07-30 Thread Alexander Solla
On Mon, Jul 30, 2012 at 2:35 PM, Henk-Jan van Tuyl hjgt...@chello.nlwrote: - Verify new wiki accounts, before granting them rights, based on e-mails in the Haskell mailing lists (or subscription of a Haskell mailing list) This is a nice idea, but I think it will end up moving spam

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

2012-07-30 Thread Ricardo Wurmus
On 31 July 2012 05:35, Henk-Jan van Tuyl hjgt...@chello.nl wrote: ... with more than one x or q This would exclude legitimate Chinese (pinyin) usernames for not much gain. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

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

2012-07-30 Thread Michael Orlitzky
On 07/30/2012 05:35 PM, Henk-Jan van Tuyl wrote: On Mon, 16 Jul 2012 00:03:49 +0200, Henk-Jan van Tuyl hjgt...@chello.nl wrote: I am willing to do administrator tasks. 4. ReCAPTCHA enabled for 'edits adding new, unrecognized external links' - which is all of the spam. This is already

Re: [Haskell-cafe] Polyvariadic composition

2012-07-30 Thread Ryan Ingram
My completely off-the-cuff guess is that a a b b isn't considered more or less specific than (x - a) ar (x - b) br since they both apply some constraint on the types. For example, it's not immediately clear that the first instance can't be used for (x - a) (x - a) (x - b) (x - b) Whereas

[Haskell-cafe] CRIP: the Curiously Reoccuring Instance Pattern

2012-07-30 Thread Ryan Ingram
With apologies to Jim Coplien :) I've been seeing this pattern in a surprising number of instance definitions lately: instance (a ~ ar, b ~ br) = Mcomp a ar b br [1] instance (b ~ c, CanFilterFunc b a) = CanFilter (b - c) a [2] The trick is that since instance selection is done entirely on the

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

2012-07-30 Thread Christian Sternagel
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) = _|_ Those axioms state that (==) is sound

Re: [Haskell-cafe] specifying using type class

2012-07-30 Thread Ryan Ingram
Generally the way this is done in Haskell is that the interface to the type is specified in a typeclass (or, alternatively, in a module export list, for concrete types), and the axioms are specified in a method to be tested in some framework (i.e. QuickCheck, SmallCheck, SmartCheck) which can

[Haskell-cafe] What does unpacking an MVar really mean?

2012-07-30 Thread Leon Smith
I admit I don't know exactly how MVars are implemented, but given that they can be aliased and have indefinite extent, I would think that they look something vaguely like a cdatatype ** var, basically a pointer to an MVar (which is itself a pointer, modulo some other things such as a thread

Re: [Haskell-cafe] What does unpacking an MVar really mean?

2012-07-30 Thread Ryan Ingram
I'm not sure I totally understand your question about 'unpacking' an MVar, but I'm going to assume you mean data structures that use the {-# UNPACK #-} pragma, like in Control.Concurrent.Future [1] and Control.Concurrent.NamedLock [2]. Here is how MVar is defined in GHC [3]: data MVar a =

Re: [Haskell-cafe] What does unpacking an MVar really mean?

2012-07-30 Thread Leon Smith
Let me clarify a bit. I am familiar with the source of Control.Concurrent.MVar, and I do see {-# UNPACK #-}'ed MVars around, for example in GHC's IO manager. What I should have asked is, what does an MVar# look like? This cannot be inferred from Haskell source; though I suppose I could

Re: [Haskell-cafe] How to define a Monad instance

2012-07-30 Thread Ryan Ingram
To take this a step further, if what you really want is the syntax sugar for do-notation (and I understand that, I love sweet, sweet syntactical sugar), you are probably implementing a Writer monad over some monoid. Here's two data structures that can encode this type; data Replacer1 k a =

Re: [Haskell-cafe] How to define a Monad instance

2012-07-30 Thread Ryan Ingram
A couple typos: instance Monad Replacer1 where - instance Monad (Replacer1 k) where instance Monad Replacer2 k where - instance Monad (Replacer2 k) where I haven't tested any of this code, so you may have to fix some minor type errors. On Mon, Jul 30, 2012 at 10:38 PM, Ryan Ingram