Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-26 Thread Daniel Trstenjak
Hi Michael, On Mon, Feb 25, 2013 at 02:41:19PM +0200, Michael Snoyman wrote: At that point, we've now made two changes to REWRITE rules: 1. They can takes a new ALWAYS parameters. 2. There's a new, special identifier currentLocation available. What would be the advantage is of that

[Haskell-cafe] Conflicting bindings legal?!

2013-02-26 Thread Andreas Abel
To your amusement, I found the following in the Agda source: abstractToConcreteCtx :: ToConcrete a c = Precedence - a - TCM c abstractToConcreteCtx ctx x = do scope - getScope let scope' = scope { scopePrecedence = ctx } return $ abstractToConcrete (makeEnv scope') x where scope =

Re: [Haskell-cafe] Conflicting bindings legal?!

2013-02-26 Thread Andreas Abel
Luckily, {-# OPTIONS -fwarn-unused-binds #-} saves me from searching for the formal spec... On 26.02.13 10:25 AM, Andreas Abel wrote: To your amusement, I found the following in the Agda source: abstractToConcreteCtx :: ToConcrete a c = Precedence - a - TCM c abstractToConcreteCtx ctx x = do

Re: [Haskell-cafe] Conflicting bindings legal?!

2013-02-26 Thread Joachim Breitner
Hi, Am Dienstag, den 26.02.2013, 10:25 +0100 schrieb Andreas Abel: To your amusement, I found the following in the Agda source: abstractToConcreteCtx :: ToConcrete a c = Precedence - a - TCM c abstractToConcreteCtx ctx x = do scope - getScope let scope' = scope { scopePrecedence =

Re: [Haskell-cafe] Conflicting bindings legal?!

2013-02-26 Thread Tillmann Rendel
Hi, Andreas Abel wrote: To your amusement, I found the following in the Agda source: abstractToConcreteCtx :: ToConcrete a c = Precedence - a - TCM c abstractToConcreteCtx ctx x = do scope - getScope let scope' = scope { scopePrecedence = ctx } return $ abstractToConcrete (makeEnv

[Haskell-cafe] Thunks and GHC pessimisation

2013-02-26 Thread oleg
Tom Ellis wrote: To avoid retaining a large lazy data structure in memory it is useful to hide it behind a function call. Below, many is used twice. It is hidden behind a function call so it can be garbage collected between uses. As you discovered, it is quite challenging to ``go against

Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-26 Thread Simon Peyton-Jones
Do you mean that the proposal itself won't work, or specifically implementing this features in terms of existing rewrite rules won't work? I meant the latter. I'll admit to ignorance on the internals of GHC, but it seems like doing the shallow source location approach would be far simpler than

Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-26 Thread Michael Snoyman
On Tue, Feb 26, 2013 at 12:06 PM, Simon Peyton-Jones simo...@microsoft.comwrote: Do you mean that the proposal itself won't work, or specifically implementing this features in terms of existing rewrite rules won't work?* *** ** ** I meant the latter. ** ** I'll admit to ignorance

Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-26 Thread Gershom Bazerman
On 2/25/13 9:42 AM, Simon Peyton-Jones wrote: I'm afraid the rewrite-rule idea won't work. RULES are applied during optimisation, when tons of inlining has happened and the program has been shaken around a lot. No reliable source location information is available there. See

Re: [Haskell-cafe] Parser left recursion

2013-02-26 Thread Martin Drautzburg
On Sunday, 24. February 2013 16:04:11 Tillmann Rendel wrote: Both approaches are essentially equivalent, of course: Before considering the very same nonterminal again, we should have consumed at least one token. I see. Thanks So for the laymen: expr ::= expr + expr is a problem, because

Re: [Haskell-cafe] Parser left recursion

2013-02-26 Thread Dominique Devriese
2013/2/26 Martin Drautzburg martin.drautzb...@web.de: I wonder if I can enforce the nonNr property somehow, i.e. enforce the rule will not consider the same nonterminal again without having consumed any input. You might be interested in this paper: Danielsson, Nils Anders. Total parser

Re: [Haskell-cafe] Thunks and GHC pessimisation

2013-02-26 Thread Tom Ellis
On Tue, Feb 26, 2013 at 10:00:32AM -, o...@okmij.org wrote: Tom Ellis wrote: To avoid retaining a large lazy data structure in memory it is useful to hide it behind a function call. Below, many is used twice. It is hidden behind a function call so it can be garbage collected between

[Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-26 Thread Corentin Dupont
Hello everybody! I am very happy to announce the beta release [1] of Nomyx, the only game where You can change the rules. This is an implementation of a Nomic [2] game in Haskell (I believe the first complete implementation). In a Nomyx game you can change the rules of the game itself while

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-26 Thread Ben Lippmeier
On 27/02/2013, at 10:28 , Corentin Dupont corentin.dup...@gmail.com wrote: Hello everybody! I am very happy to announce the beta release [1] of Nomyx, the only game where You can change the rules. Don't forget 1KBWC: http://www.corngolem.com/1kbwc/ Ben.

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-26 Thread Alexander Solla
On Tue, Feb 26, 2013 at 3:28 PM, Corentin Dupont corentin.dup...@gmail.comwrote: Hello everybody! I am very happy to announce the beta release [1] of Nomyx, the only game where You can change the rules. This is an implementation of a Nomic [2] game in Haskell (I believe the first complete

Re: [Haskell-cafe] package dependencies should distinguish between API and implementation?

2013-02-26 Thread Albert Y. C. Lai
On 13-02-25 06:50 AM, Johannes Waldmann wrote: or in general, A (and B.1) are baked into ghc, but there is some B.2/B.3 out there which U wants to use. Or is this what already happens? (ghc would notice that B.1.foo is different from B.2.foo. cabal-install would warn, but proceed? Then the

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-26 Thread Chris Wong
Hello everybody! I am very happy to announce the beta release [1] of Nomyx, the only game where You can change the rules. I just gave it a go -- it looks fun :) However, I've spotted a security hole. The current user number is stored in the URL -- if I change that number, I can masquerade as

[Haskell-cafe] derivatives and integrals

2013-02-26 Thread Christopher Howard
Hi. The scope of this question is likely bigger that Haskell, but this seems like the right crowd to ask. I'm in Calc II right now, and I'm looking for a FOSS desktop application (I use Gnu/Linux) to replace the functionality of my TI-98 in finding derivatives and integrals. (It's very convenient

Re: [Haskell-cafe] derivatives and integrals

2013-02-26 Thread Carlo Hamalainen
On Wed, Feb 27, 2013 at 3:24 PM, Christopher Howard christopher.how...@frigidcode.com wrote: I'm not sure what is the best one to start with. I was wondering if there is anyone on this list who uses free software to do that sort of simpler Calc stuff, and what it is that they use. Not sure

[Haskell-cafe] GHC API wiki update

2013-02-26 Thread satvik chauhan
I was playing with the GHC api and found that examples on the GHC wiki don't seem to work with GHC 7.6.1. Does anybody have the updated examples of the same? Regards, Satvik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] The state of binary (de)serialization

2013-02-26 Thread Vincent Hanquez
On Mon, Feb 25, 2013 at 01:30:40PM +0100, Nicolas Trangez wrote: All, In order to implement some network protocol clients recently, I needed binary serialization of commands and deserialization of responses ('Command - ByteString' and 'ByteString - Response' functions, preferably for both

Re: [Haskell-cafe] tplot (out of memory)

2013-02-26 Thread Manish Trivedi
Hi folks, Just thought it might be helpful to close this issue. Haskell tplot out of memory on centos ep6 was indeed related to the font issue. As Malcolm pointed out, installing x11 fonts resolved the issue. This yum install worked for me yum install xorg-x11-font*. Thanks, Manish On Fri,

Re: [Haskell-cafe] The state of binary (de)serialization

2013-02-26 Thread Vincent Hanquez
On Mon, Feb 25, 2013 at 11:59:42AM -0800, Johan Tibell wrote: - cereal can output a strict bytestring (runPut) or a lazy one (runPutLazy), whilst binary only outputs lazy ones (runPut) The lazy one is more general and you can use toStrict (from bytestring) to get a strict ByteString from

[Haskell-cafe] Help to write type-level function

2013-02-26 Thread Dmitry Kulagin
Hi, I try to implement typed C-like structures in my little dsl. I was able to express structures using type-level naturals (type Ty is promoted): data Ty = TInt | TBool | TStruct Symbol [Ty] That allowed to implement all needed functions, including type-level function: type family Get (n ::