Re: [Haskell-cafe] haddock - 'could not find link destination

2010-01-22 Thread Roel van Dijk
On Thu, Jan 21, 2010 at 3:06 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: But I find it easier to let Cabal deal with haddock, make a Cabal package, runghc ./Setup.hs configure --user --prefix=$HOME runghc ./Setup.hs haddock --hyperlink-source If you use a Cabal package in conjunction

[Haskell-cafe] Re: Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread Heinrich Apfelmus
Don Stewart wrote: jmillikin: Here's the fastest Haskell version I could come up with. It discards all error handling, validation, and correctness in the name of performance, but still can't get anywhere near C: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16423 Thanks for posting the

Re: [Haskell-cafe] hsql won't install due to system.time

2010-01-22 Thread Marc Weber
add old-time-1.0.0.2 to the _end_ of the build-depends line: cabal: haskelldb-hsql-sqlite3.cabal:7: Parse of field 'build-depends' failed. This is a cabal issue. Get a newer cabal and retry. Marc Weber ___ Haskell-Cafe mailing list

[Haskell-cafe] RE: ssh ports for monk and nun?

2010-01-22 Thread Bayley, Alistair
From: libraries-boun...@haskell.org [mailto:libraries-boun...@haskell.org] On Behalf Of Stefan Monnier Trying to get ssh working via putty from behind my company firewall. My recommendation is to get access to an outside machine where you run an OpenVPN server on port 80 or 443. This

Re: [Haskell-cafe] hsql won't install due to system.time

2010-01-22 Thread John Lato
Hello, Could this be a global/user install issue? That is, if the old-time package is installed per-user, and you're trying to install a package globally, the user-installed packages all show up as hidden, because they can't be dependencies of a global install. This shows up frequently because

Re: [Haskell-cafe] RE: ssh ports for monk and nun?

2010-01-22 Thread Cristiano Paris
On Fri, Jan 22, 2010 at 11:38 AM, Bayley, Alistair alistair.bay...@invesco.com wrote: ... Tried and failed. Our firewall will be closed to port 22 for the forseaable future. I'll give the OpenVPN thing a go, if I can find some time. Trying to ask how to pierce your company's firewall in a

[Haskell-cafe] Non-termination due to context

2010-01-22 Thread Emil Axelsson
Hello all! Consider the following program: {-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-} class B a = A a instance A Int class Eq a = B a instance (A a, Eq a) = B a eq :: B a = a - a - Bool eq = (==) test = 1 `eq` (2::Int) (This is a condensed version of

[Haskell-cafe] Existential Types (I guess)

2010-01-22 Thread Ozgur Akgun
Dear Cafe, I can write and use the following, data IntHolder = IntHolder Integer instance Show IntHolder where show (IntHolder n) = show n liftInt :: (Integer - Integer) - IntHolder - IntHolder liftInt f (IntHolder c) = IntHolder (f c) But I cannot generalise it to *Num:* data NumHolder

Re: [Haskell-cafe] Existential Types (I guess)

2010-01-22 Thread Neil Brown
Ozgur Akgun wrote: data NumHolder = forall a. Num a = NumHolder a instance Show NumHolder where show (NumHolder n) = show n liftNum :: (Num a) = (a - a) - NumHolder - NumHolder liftNum f (NumHolder c) = NumHolder (f c) The problem here is that you declare that liftNum will work for any

Re: [Haskell-cafe] Non-termination due to context

2010-01-22 Thread Ross Paterson
On Fri, Jan 22, 2010 at 12:24:37PM +0100, Emil Axelsson wrote: Consider the following program: {-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-} class B a = A a instance A Int class Eq a = B a instance (A a, Eq a) = B a [...] Although I don't know all

RE: [Haskell-cafe] RE: ssh ports for monk and nun?

2010-01-22 Thread Bayley, Alistair
From: cristiano.pa...@gmail.com [mailto:cristiano.pa...@gmail.com] On Behalf Of Cristiano Paris On Fri, Jan 22, 2010 at 11:38 AM, Bayley, Alistair alistair.bay...@invesco.com wrote: ... Tried and failed. Our firewall will be closed to port 22 for the forseaable future. I'll give the

Re: [Haskell-cafe] Non-termination due to context

2010-01-22 Thread Ivan Lazar Miljenovic
Ross Paterson r...@soi.city.ac.uk writes: I'm afraid you voided the warranty when you used UndecidableInstances. I like this term of phrase. Maybe it should be used in the actual documentation? ;-) -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com

Re: [Haskell-cafe] Existential Types (I guess)

2010-01-22 Thread Tom Davie
Aside from Neil's point about rank-2 polymorphism, you can of course just parameterise your NumHolder type... data Num a = NumHolder a = NumHolder a instance Show a = Show NumHolder a where show (NumHolder x) = show x instance Functor NumHolder where fmap f (NumHolder a) = NumHolder (f a)

[Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 8.5.0

2010-01-22 Thread Uwe Schmidt
Haskell XML Toolbox 8.5.0 I would like to announce a new version of the Haskell XML Toolbox. The main change in this release is the separation of the XPath module and the XSLT module into separate packages hxt-xpath and hxt-xslt. So the base package becomes a bit smaller. Installation shouldn't

Re: [Haskell-cafe] Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread Gregory Crosswhite
The following snippet of code ran ~ 33% faster than yours on my computer (GHC 6.10.4, OSX): import qualified Data.ByteString.Char8 as S import qualified Data.ByteString.Lazy as L import System.IO null_str = S.pack null main = withBinaryFile out2.json WriteMode $ \h - do hPutStr h [

Re: [Haskell-cafe] Non-termination due to context

2010-01-22 Thread Emil Axelsson
Ross Paterson skrev: On Fri, Jan 22, 2010 at 12:24:37PM +0100, Emil Axelsson wrote: Consider the following program: {-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-} class B a = A a instance A Int class Eq a = B a instance (A a, Eq a) = B a [...] Although I

RE: [Haskell-cafe] Non-termination due to context

2010-01-22 Thread Simon Peyton-Jones
It's a feature! You have * B is a superclass of A * Eq is a superclass of B So every A dictionary has a B dictionary inside it, and every B dictionary has an Eq dictionary inside it. Now, your instance declaration instance (A a, Eq a) = B a says if you give me an A dictionary and

Re: [Haskell-cafe] Spelling checker exercise

2010-01-22 Thread Daniel Fischer
Am Freitag 22 Januar 2010 07:51:27 schrieb Matthew Phillips: Hello all, sorry to bring up an old chestnut, but I’m trying to improve my Haskell-fu by writing a small program, and chose Peter Norvig’s spelling checker as my exercise material (http://norvig.com/spell-correct.html). While I’ve

Re: [Haskell-cafe] problems installing ghc-6.12.1-x86_64

2010-01-22 Thread Andrew Polonsky
On Thu, Jan 21, 2010 at 18:17, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Andrew Polonsky andrew.polon...@gmail.com writes: Help!!  I am trying to build 6.12 on a fresh 64-bit Ubuntu, with no GHC installed yet.  The compiler itself builds happily, but when I try to make install the

Re: [Haskell-cafe] hsql won't install due to system.time

2010-01-22 Thread Brian Denheyer
On Fri, 22 Jan 2010 11:17:15 + John Lato jwl...@gmail.com wrote: Hello, Could this be a global/user install issue? That is, if the old-time package is installed per-user, and you're trying to install a package globally, the user-installed packages all show up as hidden, because they

[Haskell-cafe] Re: Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread John Lato
From: Heinrich Apfelmus apfel...@quantentunnel.de Don Stewart wrote: jmillikin: Here's the fastest Haskell version I could come up with. It discards all error handling, validation, and correctness in the name of performance, but still can't get anywhere near C:

Re: [Haskell-cafe] Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread Tom Nielsen
It seems to me this indicates that the big expense here is the call into the I/O system. So let's make fewer I/O calls: import Control.Monad import qualified Data.ByteString.Char8 as S import System.IO null_str1 = S.concat $ take 1000 $ repeat $ S.pack null n1 = 500 `div` 1000 main =

[Haskell-cafe] haddock - error

2010-01-22 Thread Andrew U. Frank
the problem with me getting no haddock output whatsoever was that i had not reconfigured cabal after replacing haddock 2.4 by 2.5 (by installing it with cabal). it would be helpful if there were an error message - but i can clearly see that this is difficult to achieve in this case. thanks

Re: [Haskell-cafe] Existential Types (I guess)

2010-01-22 Thread Ozgur Akgun
OK, I wasn't storing a simple (Num a) in my holder data structure, it was more of a thing implementing one of my type classes. So it knows how to quack, and I can use it now, thanks to Neil's suggestion. I have a (somewhat) heterogeneus list of values, belonging to the same type class, and I just

[Haskell-cafe] classes with types which are wrapped in

2010-01-22 Thread Andrew U. Frank
i encounter often a problem when i have a class with some operations (say class X with push) applied to a type A b. I then wrap A in a type A_sup, with some more type parameters and i cannot write a instance of class A_sup because i have a kind mismatch. any suggestions? (reordering of the

Re: [Haskell-cafe] classes with types which are wrapped in

2010-01-22 Thread Miguel Mitrofanov
Wrap it in a newtype. That's the only way I know. Andrew U. Frank wrote: i encounter often a problem when i have a class with some operations (say class X with push) applied to a type A b. I then wrap A in a type A_sup, with some more type parameters and i cannot write a instance of class

Re: [Haskell-cafe] classes with types which are wrapped in

2010-01-22 Thread Reid Barton
On Fri, Jan 22, 2010 at 05:08:15PM +0100, Andrew U. Frank wrote: i encounter often a problem when i have a class with some operations (say class X with push) applied to a type A b. I then wrap A in a type A_sup, with some more type parameters and i cannot write a instance of class A_sup

Re: [Haskell-cafe] Web application interface

2010-01-22 Thread Jeremy Shaw
Hello, In happstack, there is a Writer monad which holds a list of filters which will be applied to the Response before sending it out. One of these filters is the gzip filter. The compression filters are defined here:

Re: [Haskell-cafe] Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread John Millikin
Correct me if I'm wrong, but ByteStrings can't contain non-ASCII values, right? I'm looking for something like this pseudo-C: typedef void (*Callback)(const uint32_t *chars, size_t n_chars, void *); WriterState *new_state (Callback, void *); I tried using the Text type, but its

Re: [Haskell-cafe] classes with types which are wrapped in

2010-01-22 Thread Steffen Schuldenzucker
Hi Andrew, Andrew U. Frank wrote: here a simplistic case (i know that A could be reduced to [], my real cases are more complicated). data A b = A b [b] data Asup x ab y = Asup x ab y class X a b where push :: b - a b - a b instance X A Int where push b' (A b bs) = A b' (b:bs)

Re: [Haskell-cafe] Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread John Millikin
There's no such thing as cheating, though that particular code won't work for my purposes because it assumes the output is merely a stream of null. Fine for the benchmark, but not extractable to the full problem. I wonder: is Handle known to be particularly slow? This code only has to work on

Re: [Haskell-cafe] Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread Don Stewart
jmillikin: There's no such thing as cheating, though that particular code won't work for my purposes because it assumes the output is merely a stream of null. Fine for the benchmark, but not extractable to the full problem. I wonder: is Handle known to be particularly slow? This code only

[Haskell-cafe] Re: Why no merge and listDiff?

2010-01-22 Thread Christian Maeder
Will Ness schrieb: Christian Maeder Christian.Maeder at dfki.de writes: Will Ness schrieb: I meant strictly increasing ordered lists, without multiples, for which the two operations, 'merge' and 'minus', would also have to produce like lists, i.e strictly increasing, without multiples.

Re: [Haskell-cafe] classes with types which are wrapped in

2010-01-22 Thread Daniel Fischer
Am Freitag 22 Januar 2010 17:08:15 schrieb Andrew U. Frank: i encounter often a problem when i have a class with some operations (say class X with push) applied to a type A b. I then wrap A in a type A_sup, with some more type parameters and i cannot write a instance of class A_sup because i

Re: [Haskell-cafe] Non-termination due to context

2010-01-22 Thread Ryan Ingram
Here's the relevant core for this file (GHC 6.10.4, so I'm a bit out of date): Rec { $dB_rh6 :: Undec.B GHC.Types.Int [GlobalId] [] $dB_rh6 = $dB_rh6 end Rec } Undec.test :: GHC.Bool.Bool [GlobalId] [] Undec.test = GHC.Classes.== @ GHC.Types.Int ($dB_rh6 `cast` ((Undec.:Co:TB)

[Haskell-cafe] http://trac.haskell.org down?

2010-01-22 Thread James Britt
Been trying to reach http://trac.haskell.org for most of the morning, but nothing comes up. Seems I'm not alone: http://downforeveryoneorjustme.com/http://trac.haskell.org James -- Neurogami - Smart application development http://www.neurogami.com ja...@neurogami.com

Re: [Haskell-cafe] http://trac.haskell.org down?

2010-01-22 Thread Neil Mitchell
Hi community.haskell.org is down as well :-( Thanks, Neil On Fri, Jan 22, 2010 at 8:41 PM, James Britt ja...@neurogami.com wrote: Been trying to reach http://trac.haskell.org for most of the morning, but nothing comes up. Seems I'm not alone:

Re: [Haskell-cafe] http://trac.haskell.org down?

2010-01-22 Thread Daniel Fischer
Am Freitag 22 Januar 2010 23:06:03 schrieb Neil Mitchell: Hi community.haskell.org is down as well :-( $ host trac.haskell.org trac.haskell.org is an alias for community.haskell.org. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] could we get a Data instance for Data.Text.Text?

2010-01-22 Thread Jeremy Shaw
Hello, Would it be possible to get a Data instance for Data.Text.Text? This would allow us to create a Serialize instance of Text for use with happstack -- which would be extremely useful. We (at seereason) are currently using this patch:

Re: [Haskell-cafe] GHC bug? Cabal bug? Haddock bug?

2010-01-22 Thread David Waern
2010/1/17 Mark Lentczner ma...@glyphic.com: AHA! Note that after running cabal haddock we re-build all of our .hi and .o files EXCEPT ./dist/build/HSsyb-with-class-0.6.1.o And now, since TH generates random symbols, we have symbols in the new .hi files that aren't in the old (and only)

Re: [Haskell-cafe] Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread Gregory Crosswhite
I would say that counts as cheating because it assumes that knowledge of the input in advance. However, I wonder how it would perform if there were a reChunk function that lazily built a new lazy ByteString by merging smaller chunks together --- i.e., it would keep pullings chunks from the

Re: [Haskell-cafe] Re: Why no merge and listDiff?

2010-01-22 Thread Derek Elkins
On Wed, Jan 20, 2010 at 9:42 AM, Will Ness will_...@yahoo.com wrote: Derek Elkins derek.a.elkins at gmail.com writes: On Sun, Jan 17, 2010 at 2:22 PM, Will Ness will_n48 at yahoo.com wrote: Hello cafe, I wonder, if we have List.insert and List.union, why no List.merge (:: Ord a = [a] -

Re: [Haskell-cafe] http://trac.haskell.org down?

2010-01-22 Thread Don Stewart
We've contacted the hosting company, who had an upgrade last night. Hopefully back up in the next hour. ndmitchell: Hi community.haskell.org is down as well :-( Thanks, Neil On Fri, Jan 22, 2010 at 8:41 PM, James Britt ja...@neurogami.com wrote: Been trying to reach

[Haskell-cafe] Re: could we get a Data instance for Data.Text.Text?

2010-01-22 Thread Bryan O'Sullivan
On Fri, Jan 22, 2010 at 2:24 PM, Jeremy Shaw jer...@n-heptane.com wrote: Would it be possible to get a Data instance for Data.Text.Text? From the last time this came up, I gather that the correctish thing to do (for reasons too obscure to me) is to teach SYB and its many cousins about Text,

[Haskell-cafe] ANN: bindings-DSL 1.0.4 (Category: FFI)

2010-01-22 Thread Maurí­cio CA
Hi, bindings-DSL is a mature and well documented preprocessor domain specific language you can use to generate bindings to a C API. It's based on functionality provided by hsc2hs. These are links to Hackage page and documentation: http://hackage.haskell.org/package/bindings-DSL