Re: [Haskell-cafe] A first glimps on the {-# NOUPDATE #-} pragma
Hi, upd_noupd n = let l = myenum' 0 n in last l + length l This could be rewritten as upd_noupd n = let l n = myenum' 0 n in last (l n) + length (l n) Or a special form of let could be introduced to define locally-scoped macros: upd_noupd n = let# l = myenum' 0 n in last l + length l What's the strength of the {-# NOUPDATE #-} approach? Regards, Facundo Date: Wed, 29 Aug 2012 10:20:21 +0200 From: Joachim Breitner breit...@kit.edu Subject: Re: [Haskell-cafe] A first glimps on the {-# NOUPDATE #-} pragma To: haskell-cafe@haskell.org Message-ID: 1346228421.4271.9.camel@kirk Content-Type: text/plain; charset=iso-8859-15 Hi, Am Dienstag, den 28.08.2012, 18:16 -0400 schrieb Carter Schonwald: On Tuesday, August 28, 2012, Yves Par?s wrote: Monad? Simple strictness anotation is enough in that case: upd_noupd n = let l = myenum' 0 n h = head l in h `seq` last l + h darn, I though I changed my examples before posting to: upd_noupd n = let l = myenum' 0 n in last l + length l (head was a bad example because actually due to strictness analysis and worker/wrapper transformation, GHC would yield good code even without `seq`). In this case (which is actually the benchmarked case), reordering or strictness annotations do not help. Greetings and sorry for the confusion, Joachim -- Dipl.-Math. Dipl.-Inform. Joachim Breitner Wissenschaftlicher Mitarbeiter http://pp.info.uni-karlsruhe.de/~breitner ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell-Cafe Digest, Vol 108, Issue 22
I have one unbearable doubt, how do you accent CoCoCo? CóCoCo? CoCóCo? CoCoCó? Facundo Date: Thu, 16 Aug 2012 21:40:28 +0200 From: Doaitse Swierstra doai...@swierstra.net Subject: [Haskell-cafe] [Announce] Compositional Compiler Construction, Oberon0 examples available To: haskell-cafe@haskell.org Cafe haskell-cafe@haskell.org, Haskell List hask...@haskell.org Message-ID: 3b4b9ffc-b1bb-4156-be80-5e60632ee...@swierstra.net Content-Type: text/plain; charset=us-ascii Over the years we have been constructing a collection of Embedded Domain Specific Languages for describing compilers which are assembled from fragments which can be compiled individuallu. In this way one can gradually ``grow a langauge'' in a large number of small steps. The technique replaces things like macro extensions or Template Haskell; it has become feasable to just extend the language at hand by providing extra modules. The nice thing is that existing code does not have to be adapted, nor has to be available nor has to be recompiled. Recently we have been using (and adapting) the frameworks such that we could create an entry in the ldta11 (http://ldta.info/tool.html) tool challenge, where one has to show how one's tools can be used to create a compiler for the Oberon0 language, which is used a a running example in Wirth's compiler construction book. We have uploaded our implementation to hackage at: http://hackage.haskell.org/package/oberon0. More information can be found at the wiki: http://www.cs.uu.nl/wiki/bin/view/Center/CoCoCo You may take a look at the various Gram modules to see how syntax is being defined, and at the various Sem modules to see how we use our first class attribute grammars to implement the static semantics associated with the various tasks of the challenge. We hope you like it, and comments are welcome, Marcos Viera Doaitse Swierstra ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Announce] Compositional Compiler Construction, Oberon0 examples available
Sorry, fixed the subject. On Fri, Aug 17, 2012 at 11:11 AM, Facundo Domínguez facundoming...@gmail.com wrote: I have one unbearable doubt, how do you accent CoCoCo? CóCoCo? CoCóCo? CoCoCó? Facundo Date: Thu, 16 Aug 2012 21:40:28 +0200 From: Doaitse Swierstra doai...@swierstra.net Subject: [Haskell-cafe] [Announce] Compositional Compiler Construction, Oberon0 examples available To: haskell-cafe@haskell.org Cafe haskell-cafe@haskell.org, Haskell List hask...@haskell.org Message-ID: 3b4b9ffc-b1bb-4156-be80-5e60632ee...@swierstra.net Content-Type: text/plain; charset=us-ascii Over the years we have been constructing a collection of Embedded Domain Specific Languages for describing compilers which are assembled from fragments which can be compiled individuallu. In this way one can gradually ``grow a langauge'' in a large number of small steps. The technique replaces things like macro extensions or Template Haskell; it has become feasable to just extend the language at hand by providing extra modules. The nice thing is that existing code does not have to be adapted, nor has to be available nor has to be recompiled. Recently we have been using (and adapting) the frameworks such that we could create an entry in the ldta11 (http://ldta.info/tool.html) tool challenge, where one has to show how one's tools can be used to create a compiler for the Oberon0 language, which is used a a running example in Wirth's compiler construction book. We have uploaded our implementation to hackage at: http://hackage.haskell.org/package/oberon0. More information can be found at the wiki: http://www.cs.uu.nl/wiki/bin/view/Center/CoCoCo You may take a look at the various Gram modules to see how syntax is being defined, and at the various Sem modules to see how we use our first class attribute grammars to implement the static semantics associated with the various tasks of the challenge. We hope you like it, and comments are welcome, Marcos Viera Doaitse Swierstra ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads
That precedent supports the view that e.g. a command-line flag shouldn't affect behavior without the type reflecting it, e.g. by doing IO, but the de facto use of the unsafe IO trick means not everyone agrees. For those interested, here's [1] a case where treating command line arguments as top level constants went wrong. Look specifically at the section named Crime Doesn't Pay. Best, Facundo [1] http://www.aosabook.org/en/ghc.html Date: Tue, 3 Jul 2012 17:49:48 -0400 From: Alvaro Gutierrez radi...@google.com Subject: Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads To: Dominique Devriese dominique.devri...@cs.kuleuven.be Cc: haskell-cafe@haskell.org Message-ID: cac6k+tpuidrtac_ccfa9ewawdpg1adaht96rgmc_s5wtvjw...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 On Thu, Jun 28, 2012 at 2:53 PM, Dominique Devriese dominique.devri...@cs.kuleuven.be wrote: 2012/6/27 Tillmann Rendel ren...@informatik.uni-marburg.de: How would you implement this requirement in Haskell without changing the line amount (Leaf x) = x? I may be missing the point here, but having worked on large code bases with a wide variety contributors before, I find it very advantageous that programmers are prevented from writing an amount function whose behaviour depends on command line arguments without at least an indication in the type. The fact that the function can not perform stuff like that is precisely the guarantee that the Haskell type gives me... I don't think there's an answer that's uniformly right; it depends on whether you think of the input to the program, e.g. the environment, command-line arguments, etc. as 'constant' and in some sense, pure. The latter are constant in the sense that they never change, but they are not fixed at compile-time. Other languages effectively treat them as pure (by passing them directly to main), whereas Haskell chooses not to, which is probably the reason why getArgs has IO in its type (something that seems unintuitive at first.) That precedent supports the view that e.g. a command-line flag shouldn't affect behavior without the type reflecting it, e.g. by doing IO, but the de facto use of the unsafe IO trick means not everyone agrees. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Haskell] ANNOUNCE: notcpp-0.0.1
Hi, scopeLookup :: String - Q Exp The example provided here [1] fails at runtime is no name can be found in scope. Would it make more sense to have scopeLookup :: [String] - Q Exp and have compilation fail if no name in the list is in scope? By the way, the library brings an interesting approach to conditional compilation. Facundo [1] http://hackage.haskell.org/packages/archive/notcpp/0.0.1/doc/html/NotCPP-ScopeLookup.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Is fusion overrated?
which is capable of producing elements one-by-one. So the whole thing probably should run in constant space as well. Besides reducing the amount of GC calls, performance would also improve because the GC calls that remain are cheaper. The original program may run in constant space, but the fused program may use even a smaller constant space. Which in turn means that whenever the GC needs to make a pass, it is faster. Facundo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Do exist globally available hosting project services?
Dear haskellers, I was reading the terms of service of the Haskell Community Server and found this statement: Users residing in countries on the United States Office of Foreign Assets Control sanction list, including Cuba, Iran, Libya, North Korea, Sudan and Syria, may not post or access CONTENT available through OUR services. I wonder whether there is a solution for hosting projects which does not discriminate people by their place of residence. http://code.haskell.org http://www.patch-tag.com https://github.com all seem to be ruled under USA laws. Would anybody recommend an alternative? Best, Facundo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe