Re: [Haskell-cafe] Parsec bug, or...?

2009-10-13 Thread Martijn van Steenbergen
Brandon S. Allbery KF8NH wrote: My fix would be to have myPrefixOf require the prefix be terminated in whatever way is appropriate (end of input, white space, operator?) instead of simply accepting as soon as it gets a prefix match regardless of what follows. Maybe you can use notFollowedBy

Re: [Haskell-cafe] MTL vs Transformers?

2009-10-13 Thread Martijn van Steenbergen
Erik de Castro Lopo wrote: However after reading the hackage descriptions of both Transformers and MTL, it seems that they share a very similar heritage. I therefore hacked the iteratee.cabal file and replaced the build-depends on transformers with one on mtl and the package built quite happily.

RE: [Haskell-cafe] Type-level naturals multiplication

2009-10-13 Thread Simon Peyton-Jones
| Is there any way to define type-level multiplication without requiring | undecidable instances? | | No, not at the moment. The reasons are explained in the paper Type | Checking with Open Type Functions (ICFP'08): | |http://www.cse.unsw.edu.au/~chak/papers/tc-tfs.pdf | | We want to

Re: [Haskell-cafe] MTL vs Transformers?

2009-10-13 Thread Daniel Schüssler
On Tuesday 13 October 2009 02:46:29 Erik de Castro Lopo wrote: Hi all, I've just received the following error message: headers.hs:6:7: Could not find module `Control.Monad.Identity': it was found in multiple packages: transformers-0.1.4.0 mtl-1.1.0.2 I'm trying to use the

[Haskell-cafe] Re: MTL vs Transformers?

2009-10-13 Thread John Lato
From: Erik de Castro Lopo mle...@mega-nerd.com Well Iteratee built with MTL passes all the tests that shipped with it so I suppose it must be correct. Unfortunately the iteratee tests aren't exhaustive, but if it builds with MTL it should work. I'm more surprised that it built just by

Re: [Haskell-cafe] What *is* a DSL?

2009-10-13 Thread Nils Anders Danielsson
On 2009-10-07 17:29, Robert Atkey wrote: A deep embedding of a parsing DSL (really a context-sensitive grammar DSL) would look something like the following. I think I saw something like this in the Agda2 code somewhere, but I stumbled across it when I was trying to work out what free applicative

RE: [Haskell-cafe] Re: Libraries for Commercial Users

2009-10-13 Thread Simon Peyton-Jones
There is no difficulty in principle with Haskell on JVM. There are, however, some obstacles in practice, as this page describes: http://haskell.org/haskellwiki/GHC:FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F The way stands open for someone with design taste, knowledge of the JVM,

[Haskell-cafe] Time Typeable Instances

2009-10-13 Thread John Goerzen
Hugo Gomes wrote: The Glorious Glasgow Haskell Compilation System, version 6.10.4 with old-time-1.0.0.2 and time-1.1.2.4 This is a standard haskell platform on a windows xp. Cabal install didn't work complaining about missing instances of typeable for posix time and other datatypes, yet,

Re: [Haskell-cafe] Parsec bug, or...?

2009-10-13 Thread Uwe Hollerbach
On 10/12/09, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Brandon S. Allbery KF8NH wrote: My fix would be to have myPrefixOf require the prefix be terminated in whatever way is appropriate (end of input, white space, operator?) instead of simply accepting as soon as it gets a

Re: [Haskell-cafe] Type-level naturals multiplication

2009-10-13 Thread Brad Larsen
On Tue, Oct 13, 2009 at 3:37 AM, Simon Peyton-Jones simo...@microsoft.com wrote: [...] It's also worth noting that while undecidable instances sound scary, but all it means is that the type checker can't prove that type inference will terminate.  We accept this lack-of-guarantee for the

[Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals multiplication)

2009-10-13 Thread Brad Larsen
On Tue, Oct 13, 2009 at 3:37 AM, Simon Peyton-Jones simo...@microsoft.com wrote: | Is there any way to define type-level multiplication without requiring | undecidable instances? | | No, not at the moment.  The reasons are explained in the paper Type | Checking with Open Type Functions

Re: [Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals multiplication)

2009-10-13 Thread Lennart Augustsson
Yes, there are simple H-M examples that are exponential. x0 = undefined x1 = (x1,x1) x2 = (x2,x2) x3 = (x3,x3) ... xn will have a type with 2^n type variables so it has size 2^n. -- Lennart On Tue, Oct 13, 2009 at 6:04 PM, Brad Larsen brad.lar...@gmail.com wrote: On Tue, Oct 13, 2009 at 3:37

Re: [Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals multiplication)

2009-10-13 Thread Serguey Zefirov
2009/10/13 Lennart Augustsson lenn...@augustsson.net: Yes, there are simple H-M examples that are exponential. x0 = undefined x1 = (x1,x1) x2 = (x2,x2) x3 = (x3,x3) ... xn will have a type with 2^n type variables so it has size 2^n. Reformulated: let dup x = (x,x) :t dup . dup . dup . dup

Re: [Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals multiplication)

2009-10-13 Thread Brad Larsen
On Tue, Oct 13, 2009 at 12:32 PM, Serguey Zefirov sergu...@gmail.com wrote: 2009/10/13 Lennart Augustsson lenn...@augustsson.net: Yes, there are simple H-M examples that are exponential. x0 = undefined x1 = (x1,x1) x2 = (x2,x2) x3 = (x3,x3) ... xn will have a type with 2^n type variables

[Haskell-cafe] Re: [Haskell-beginners] using quickcheck for blackbox testing for 3rd party apps.

2009-10-13 Thread Daniel Fischer
Am Dienstag 13 Oktober 2009 18:04:52 schrieb Brent Yorgey: Brent * Some smart-alecks might pipe up with something about unsafePerformIO   here.  But that's not a cure, it's more like performing an emergency   tracheotomy with a ballpoint pen. Quote of the month!

[Haskell-cafe] Reverse dependencies in Hackage

2009-10-13 Thread Roel van Dijk
A few weeks ago I wrote a patch that adds reverse dependencies to hackage [1]. I have know hosted a small test hackage which demonstrates this feature. It can be found here: http://bifunctor.homelinux.net/~roel/hackage Browse to your favorite packages and find out how much other packages depend

Re: [Haskell-cafe] ** for nested applicative functors?

2009-10-13 Thread Conal Elliott
Hi Kim-Ee, This pattern shows up in Applicative programming with effects in showing that the composition of applicatives is applicative: (*) = liftA2 (*), and pure = pure.pure . (Really, you have to manage newtype wrappers as well. See the TypeCompose library.) - Conal On Mon, Oct 12, 2009

Re: [Haskell-cafe] GHC core packages: same core?

2009-10-13 Thread Max Bolingbroke
Hi Dimitry, ghc-core is a pretty-printer for GHC's internal Core language (you can get a non-pretty-printed version simply by compiling with (IIRC) -dverbose-core2core). This is what we actually optimize and generate code from, and the formatting of this output might change at any time. This is

Re: [Haskell-cafe] a library for control of terminal driver modes?

2009-10-13 Thread Max Bolingbroke
Yes, ansi-terminal supports this. Try: setSGR [SetBlinkSpeed NoBlink] (http://hackage.haskell.org/packages/archive/ansi-terminal/0.5.0/doc/html/System-Console-ANSI.html) Cheers, Max 2009/10/12 Iain Barnett iainsp...@gmail.com: On 11 Oct 2009, at 15:30, Andrew Coppin wrote: Iain Barnett

Re: [Haskell-cafe] a library for control of terminal driver modes?

2009-10-13 Thread Max Bolingbroke
Err, I managed to completely misread your email. Sorry. Unfortunately, ansi-terminal does NOT support disabling the echo and I don't plan to support it. However, given that I already provide non-ANSI features from it, patches would be happily accepted :-) Cheers, Max 2009/10/13 Max Bolingbroke

Re: [Haskell-cafe] GHC core packages: same core?

2009-10-13 Thread Dimitry Golubovsky
Max, Thanks for the explanation. So, the extcore library is expected to match the spec in http://www.haskell.org/ghc/docs/6.10.4/html/ext-core/core.pdf and the core itself can be produced with -fext-core, correct? I think it might be interesting for people working on alternative backends

[Haskell-cafe] Re: Reverse dependencies in Hackage

2009-10-13 Thread Duncan Coutts
On Tue, 2009-10-13 at 21:30 +0200, Roel van Dijk wrote: I also noticed that work is underway to implement a new hackage-server [2] based on happstack. If people find this feature useful I could also write a patch against the hackage-server code base [3]. That would be much appreciated.

[Haskell-cafe] why does iterateNTimes (10^6) (ap . liftM (:) . return $ 0) (return []) produce output in the IO monad, but stack overflow in the maybe monad?

2009-10-13 Thread Thomas Hartman
Can someone explain why the one stack overflows and the other one doesn't? iterateNTimes i f x = foldr (.) id (replicate i f) $ x tntIO :: IO Int -- same as replicateM (10^6) $ return 0 , and same as sequence . replicate (10^6) $ return 0 tntIO = iterateNTimes (10^6) (ap . liftM (:) . return $ )

Re: Fwd: [Haskell-cafe] Haskell for Physicists

2009-10-13 Thread Xiao-Yong Jin
Don Stewart d...@galois.com writes: Hey all, Following up on this, I'm presenting a position paper tomorrow on the use of EDSLs to improve productivity and lower cost when developing code for new high performance architectures (like GPUs).

Re: [Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals multiplication)

2009-10-13 Thread Dan Doel
On Tuesday 13 October 2009 1:06:41 pm Brad Larsen wrote: Good example! I have a feeling that the `dup' example is a bit contrived, not something that one would be likely to find in the wild. This is, after all, why HM is useful. In general, there are programs that take exponential time/space

Re: [Haskell-cafe] Type-level naturals multiplication

2009-10-13 Thread Martin Sulzmann
On Tue, Oct 13, 2009 at 9:37 AM, Simon Peyton-Jones simo...@microsoft.comwrote: | Is there any way to define type-level multiplication without requiring | undecidable instances? | | No, not at the moment. The reasons are explained in the paper Type | Checking with Open Type Functions

[Haskell-cafe] Re: why does iterateNTimes (10^6) (ap . liftM (:) . return $ 0) (return []) produce output in the IO monad, but stack overflow in the maybe monad?

2009-10-13 Thread Thomas Hartman
correction, should be: iterateNTimes i f x = foldr (.) id (replicate i f) $ x tntIO :: IO Int -- same as replicateM (10^6) $ return 0 tntIO = return . head = (iterateNTimes (10^6) (ap . liftM (:) . return $ 0) (return [])) -- produces output tntMb :: Maybe Int -- overflows tntMb = return . head =

Re: Fwd: [Haskell-cafe] Haskell for Physicists

2009-10-13 Thread Daryoush Mehrtash
Of all the projects that are in the HackageDB, how many, or what % do you say developed an EDSL? daryoush On Tue, Oct 13, 2009 at 3:06 PM, Xiao-Yong Jin xj2...@columbia.edu wrote: Don Stewart d...@galois.com writes: Hey all, Following up on this, I'm presenting a position paper tomorrow

[Haskell-cafe] (no subject)

2009-10-13 Thread oleg
Martin Sulzmann wrote: Undecidable instances means that there exists a program for which there's an infinite reduction sequence. I believe this may be too strong of a statement. There exists patently terminating type families that still require undecidable instances in GHC. Here is an example: