Re: [Haskell-cafe] Does anyone maintain trac.haskell.org?
The community Trac hosting server isn't sending email, which Trac requires. I've submitted several tickets to supp...@community.haskell.org but gotten no response. Does anyone maintain that server anymore? Had the same problem in July. Raised a ticket etc. I don't think there is anyone actually responsible for the trac server. Indeed, the community server (including trac) is administered on a volunteer best-effort basis. Unfortunately, we do not have sufficient trac-admin expertise on the volunteer team in order to know what is wrong here, or to fix it. If there is a trac expert out there who could help us diagnose and fix the problem, we would be glad of their aid. Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why doesn't this work? (palindrome :: IO)
Why do you people hate 'if' statements? 2011/12/9 Brandon Allbery allber...@gmail.com On Thu, Dec 8, 2011 at 15:52, Tom Murphy amin...@gmail.com wrote: On Wed, Dec 7, 2011 at 11:46 PM, Brandon Allbery allber...@gmail.comwrote: case () of () | s == reverse s - putStrLn palindrome _ - putStrLn nope This is kind of a hack of case, though. I think what the OP was looking for is isPalindrome word | (word == reverse word) = putStrLn (word ++ is a palindrome) | otherwise = putStrLn (word ++ is not a palindrome) Erm? It's as much of a hack of case as yours is, since the above is actually using case. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] No instance for (Read POSIXTime)
Hi, I need to read / write epoch seconds from / to plain text files. When I try to read POSIXTime that I use in my own data type: data TimedClassRecT = TCR {timeStamp :: POSIXTime, classCosMap :: Map.Map String Float} deriving (Eq, Read, Show) I get the following error: No instance for (Read POSIXTime) arising from the 'deriving' clause of a data type declaration Possible fix: add an instance declaration for (Read POSIXTime) or use a standalone 'deriving instance' declaration, so you can specify the instance context yourself When deriving the instance for (Read TimedClassRecT) What should I do to provide Read instance for POSIXTime? I would rather not implement it myself. Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why doesn't this work? (palindrome :: IO)
On Fri, Dec 9, 2011 at 04:16, Yves Parès limestr...@gmail.com wrote: Why do you people hate 'if' statements? It's more that the language spec does; if statements, along with a number of other things, desugar to case which is the fundamental conditional construct. (And more personally, I find the indentation behavior annoying, in that I need to indent then and else more inside something that uses layout; plus the lack of an else if that is aware of being part of a compound means that it ladders even more, so I end up switching to case just to keep from ending up on column 200 or something.) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why doesn't this work? (palindrome :: IO)
I agree with all that, but in *this *special case, I think that case something of True - False - is less nice and obvious than if something then else 2011/12/9 Brandon Allbery allber...@gmail.com On Fri, Dec 9, 2011 at 04:16, Yves Parès limestr...@gmail.com wrote: Why do you people hate 'if' statements? It's more that the language spec does; if statements, along with a number of other things, desugar to case which is the fundamental conditional construct. (And more personally, I find the indentation behavior annoying, in that I need to indent then and else more inside something that uses layout; plus the lack of an else if that is aware of being part of a compound means that it ladders even more, so I end up switching to case just to keep from ending up on column 200 or something.) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why doesn't this work? (palindrome :: IO)
On Fri, Dec 9, 2011 at 05:16, Yves Parès limestr...@gmail.com wrote: I agree with all that, but in *this *special case, I think that I should also note that the OP mentioned using if, but was surprised/confused by the behavior of case, which is why that's what we've been focusing on. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Cabal issue
I understand that this may have been addressed before on this list in some form, so I'll be brief: Had problem with deprecated package, was told my only option was to wipe my Haskell install and start over. Is this true and if so, doesn't this mean that Cabal (or the package management system that it is a part of) is broken? Details here: https://plus.google.com/u/0/111705054912446689620/posts/V1186HGWEap Kevin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Recommended class instances for container type
It's just a variant of Data.Map that takes intervals as keys and offers an efficient stabbing query. I'm reasonably optimistic on the performance front. Will probably release a 0.1 soon. Thanks again for all opinions, Chris Am 08.12.2011 20:41 schrieb Johan Tibell johan.tib...@gmail.com: On Thu, Dec 8, 2011 at 8:12 AM, Christoph Breitkopf chbreitk...@googlemail.com wrote: Hello, I'm in the process of implementing a container data type, and wonder what class instances are generally considered necessary. E.g. is it ok to start out with a Show that's adequate for debugging, or is it a 'must' to include instances of everything possible (Eq, Ord if possible, Read, Show, Functor, ...). Start out with Show and spend your time making sure that you're container type performs well (unless you're doing this as an exercise of course). A featureful API for something that's as slow as linked lists isn't very useful. ;) -- Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal issue
Not what you asked for, but.. Although the documentation looks somewhat cryptic, and I have not use it at all, a nix + cabal option seems to be in the works. Search google for nix haskell. I am guessing that their Hydra continuous build system which is built on top of nix also could do wonders for hackage. Alexander On 9 December 2011 12:20, Kevin Jardine kevinjard...@gmail.com wrote: I understand that this may have been addressed before on this list in some form, so I'll be brief: Had problem with deprecated package, was told my only option was to wipe my Haskell install and start over. Is this true and if so, doesn't this mean that Cabal (or the package management system that it is a part of) is broken? Details here: https://plus.google.com/u/0/111705054912446689620/posts/V1186HGWEap Kevin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal issue
On Fri, Dec 9, 2011 at 5:20 AM, Kevin Jardine kevinjard...@gmail.com wrote: I understand that this may have been addressed before on this list in some form, so I'll be brief: Had problem with deprecated package, was told my only option was to wipe my Haskell install and start over. Is this true and if so, doesn't this mean that Cabal (or the package management system that it is a part of) is broken? It's hard to say for sure what the fix is without knowing what the error is. Wiping your installed packages db is easy, so it is often recommended. Details here: https://plus.google.com/u/0/111705054912446689620/posts/V1186HGWEap Kevin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell functions caller-callee details
Hi, Given a Haskell package is there a way I can get each functions' caller-callee details? Are there any existing tools/libraries that can help me get this data from the source? Appreciate any inputs in this regard. Thanks! SK -- Shakthi Kannan http://www.shakthimaan.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell functions caller-callee details
On 9 December 2011 16:41, Shakthi Kannan shakthim...@gmail.com wrote: Given a Haskell package is there a way I can get each functions' caller-callee details? Are there any existing tools/libraries that can help me get this data from the source? Check out SourceGraph: http://hackage.haskell.org/package/SourceGraph ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] web-routes-quasi: Generating a route type
Hello there, I'm trying to use the web-routes-quasi package outside of Yesod. Is there any documentation on how to use TH to generate a route type just like Yesod does? Or is that a Yesod-specific feature? I don't need the actual automatic dispatch or anything, just a type to work with. If it's not possible, I will just go ahead and (ab-) use the constructor strings. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife = sex) http://ertes.de/ signature.asc Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Generating Code
Hello, In an attempt to reduce the amount of boring repetitive work to update the OpenGLRaw package I've created a generator to do it partially for me. It currently uses haskell-src-exts for representing the haskell source of the modules. Though haskell-src-exts does an excellent job for representing haskell source, it seems to be more aimed at parsing haskell source and doing something with it, rather than generating it. For cpp macros, say for the use of different calling conventions used, can't be used directly, nor is there a really good way to use comments (at least so it seems to me). So I'm interested if there are other libraries that are more suitable to the task of generating haskell code for library use, and thus generate 'human readable' exported code (so no TH). I'm also interested in how other projects generate code for their packages. Greetings, Lars Corbijn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Code
On Fri, Dec 9, 2011 at 1:45 PM, L Corbijn aspergesoe...@gmail.com wrote: Hello, In an attempt to reduce the amount of boring repetitive work to update the OpenGLRaw package I've created a generator to do it partially for me. It currently uses haskell-src-exts for representing the haskell source of the modules. Though haskell-src-exts does an excellent job for representing haskell source, it seems to be more aimed at parsing haskell source and doing something with it, rather than generating it. For cpp macros, say for the use of different calling conventions used, can't be used directly, nor is there a really good way to use comments (at least so it seems to me). So I'm interested if there are other libraries that are more suitable to the task of generating haskell code for library use, and thus generate 'human readable' exported code (so no TH). I'm also interested in how other projects generate code for their packages. I've used 'haskell-src' to generate code, but thankfully I didn't need to include any CPP. I've wanted to experiment with using haskell-src-exts to generate code with Haddocks, but it looks like it will be painful, since it doesn't include comments in the syntax tree proper. This is appropriate for arbitrary comments, but Haddocks can only appear in specific locations (I think?). Here is a utility module I use as a wrapper around haskell-src to make it a bit friendlier for generating modules: http://code.haskell.org/~aslatter/code/xhb/build-utils/src/HaskellCombinators.hs Maybe you can add an 'OtherCall String' calling convention to haskell-src-exts? I'm not sure what to do about comments. Antoine ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Code
On Fri, Dec 9, 2011 at 20:45, L Corbijn aspergesoe...@gmail.com wrote: So I'm interested if there are other libraries that are more suitable to the task of generating haskell code for library use, and thus generate 'human readable' exported code (so no TH). I'm also interested in how other projects generate code for their packages. Since you ask how other packages solve this problem, and since most packages use template haskell, I have to ask: why can't you use template haskell for this? Another option (also not code generation, but very useful in reducing boilerplate) is generic programming, for example using the 'regular' package, or the new generics in GHC 7.2. Erik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANNOUNCE: HaTeX 3.1.0 (and HaTeX-meta 1.1.0)
Hello Cafe! Today I released to Hackage a new version of the HaTeX package ( http://hackage.haskell.org/package/HaTeX-3.1.0 ). If you don't know HaTeX, it is a combinator library of the LaTeX syntax. Visit the homepage for more information: http://dhelta.net/hprojects/HaTeX Highlights: + Added warnings (See Text.LaTeX.Base.Warnings). Still very experimental. + Added an Examples directory, with a simple example inside to get started. + Num instance for LaTeX and LaTeXT. + New package implemented AMSThm (See Text.LaTeX.Packages.AMSThm). See the ReleaseNotes in the source tarball for more details in release changes. With it, I released an update of HaTeX-meta (version 1.1.0), which produces part of the HaTeX code. An important change here is the addition of the HATEX pragma (explained in http://deltadiaz.blogspot.com/2011/11/hatex-pragma.html ). If you need something more, feel free to contact me or send me a patch. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Code
On Fri, Dec 9, 2011 at 9:17 PM, Erik Hesselink hessel...@gmail.com wrote: On Fri, Dec 9, 2011 at 20:45, L Corbijn aspergesoe...@gmail.com wrote: So I'm interested if there are other libraries that are more suitable to the task of generating haskell code for library use, and thus generate 'human readable' exported code (so no TH). I'm also interested in how other projects generate code for their packages. Since you ask how other packages solve this problem, and since most packages use template haskell, I have to ask: why can't you use template haskell for this? Another option (also not code generation, but very useful in reducing boilerplate) is generic programming, for example using the 'regular' package, or the new generics in GHC 7.2. Erik That's a good question, and maybe I should have answered it the first place. The short answer is, I'm trying to generate modules from scratch (or spec) so there is no module yet to put the template haskell in. But I think, with my limited knowledge of template haskell, that it tries to solve a different problem, to explain it more detailed I'll first elaborate on the problem that I want to solve. I'm trying to do, in general, is generating a package (almost) from scratch by using a specification of what it should be. The specific problem is that the OpenGLRaw package is quite out of date and needs updating. This package is in essence a large FFI import of the OpenGL specification from C. To update it (or recreate it), with it's hundreds of functions and enumeration values, is not only boring but also tedious and error prone work. As there is a specification of all this a better option would be to generate it. The starting point for such generator would be only with a few helper functions and the OpenGL specification. It would then generate all the enumeration values and function imports (split over several modules). The major set of problems for using template haskell is that it doesn't have the correct features, or better said it tries to solve another problem. Template haskell generates code into an existing module, while for this problem there is no module yet to generate it into. Of course I could generate those modules and let template haskell make the FFI imports, but then the problem remains how to generate those modules. So template haskell seems (as I see it) to solve the problem of writing almost the same code twice by generating it from some parameters coded in some source file. Another problem is that the export and import lists of the modules need to be generated too and this seems not an option for TH. Lars ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Code
Geoffrey Mainland did significant work generating C with his GHC quasi quote extension. I'm not sure the status or availability of the code but there was a good Haskell Workshop paper describing it. For the specific problem of OpenGL - as the package already exists I'm not sure a generative approach would actually pay its way ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANNOUNCE: Workflow-0.5.8.0
This is A new version of the package workflow. I probably will change the name of this package since it is too generic. A workflow can be seen as a persistent thread that executes a monadic computation. Therefore, it can be used in very time consuming computations such are CPU intensive calculations with intermediate results or with procedures that are most of the time waiting for the response of a process or an user, that are prone to comunication failures, timeouts or shutdowns. Workflow has a operation, called step that lift the monadic computation to the Workflow monad. This bring services of transparent state loogging, so that the computation can be restarted at the point of stop/failure. Additionally , the package has persistent queues, persistent data collections, and persistent timeouts (whit which the workflow can wait for days, months or even years, more than the average time between failures). This is important for programming office workflow or in election processes where the user has a limited time to decide/vote. This version has many improvements: it admits Data.Binary serialization for logging (besides RefSerialize of previous versions). . It also has an EDSL of high level monadic combinators that represent workflow patterns. For example, split, merge, synchronization, votation etc. There are examples in the online documentation and some demos in the package. My motivation for developping Workflow is to use it in a project for electronic democracy in the Web. If anyone is interested in the package Workflow and/or electronic democracy, I will be happy to talk with him. Hope to be useful Alberto. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Code
On Fri, Dec 9, 2011 at 2:17 PM, Erik Hesselink hessel...@gmail.com wrote: On Fri, Dec 9, 2011 at 20:45, L Corbijn aspergesoe...@gmail.com wrote: So I'm interested if there are other libraries that are more suitable to the task of generating haskell code for library use, and thus generate 'human readable' exported code (so no TH). I'm also interested in how other projects generate code for their packages. Since you ask how other packages solve this problem, and since most packages use template haskell, I have to ask: why can't you use template haskell for this? For my case, template haskell can't create modules, and template haskell solves a different problem - I've not interested in creating Haskell declarations from Haskell declarations - I'm interested in creating Haskell modules from an external, formal, specification. In a sense I'm compiling to Haskell. Another option (also not code generation, but very useful in reducing boilerplate) is generic programming, for example using the 'regular' package, or the new generics in GHC 7.2. Erik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal issue
On Fri, Dec 9, 2011 at 06:20, Kevin Jardine kevinjard...@gmail.com wrote: Had problem with deprecated package, was told my only option was to wipe my Haskell install and start over. Is this true and if so, doesn't this mean that Cabal (or the package management system that it is a part of) is broken? http://ivanmiljenovic.wordpress.com/2010/03/15/repeat-after-me-cabal-is-not-a-package-manager/ (in short: yes, it's broken, and probably not fixable. cabal is a friendlyish wrapper for ghc-pkg, which is not a package manager in the sense many people want it to be, and it never will be.) Something *really* needs to be done about its absurd willingness to blindly override bootlibs and thereby break things, though. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Code
On Dec 9, 2011 4:48 PM, Stephen Tetley stephen.tet...@gmail.com wrote: For the specific problem of OpenGL - as the package already exists I'm not sure a generative approach would actually pay its way I strongly disagree. OpenGLRaw is in pretty bad shape right now. It's not up to date with the OpenGL spec and is very difficult to maintain. A generator is exactly what is needed. - Jake ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Code
On Fri, Dec 9, 2011 at 17:27, Antoine Latter aslat...@gmail.com wrote: On Fri, Dec 9, 2011 at 2:17 PM, Erik Hesselink hessel...@gmail.com wrote: Since you ask how other packages solve this problem, and since most packages use template haskell, I have to ask: why can't you use template haskell for this? For my case, template haskell can't create modules, and template haskell solves a different problem - I've not interested in creating Haskell declarations from Haskell declarations - I'm interested in creating Haskell modules from an external, formal, specification. In a sense I'm compiling to Haskell. It occurs to me that c2hs (or more appropriately the gtk2hsc2hs fork) is intended to solve this problem; have you looked into it? -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell functions caller-callee details
Hi, --- On Fri, Dec 9, 2011 at 9:47 PM, Bas van Dijk v.dijk@gmail.com wrote: | Check out SourceGraph: | | http://hackage.haskell.org/package/SourceGraph \-- Thank you very much! SK -- Shakthi Kannan http://www.shakthimaan.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Generating Code
On Fri, Dec 9, 2011 at 6:32 PM, Brandon Allbery allber...@gmail.com wrote: On Fri, Dec 9, 2011 at 17:27, Antoine Latter aslat...@gmail.com wrote: On Fri, Dec 9, 2011 at 2:17 PM, Erik Hesselink hessel...@gmail.com wrote: Since you ask how other packages solve this problem, and since most packages use template haskell, I have to ask: why can't you use template haskell for this? For my case, template haskell can't create modules, and template haskell solves a different problem - I've not interested in creating Haskell declarations from Haskell declarations - I'm interested in creating Haskell modules from an external, formal, specification. In a sense I'm compiling to Haskell. It occurs to me that c2hs (or more appropriately the gtk2hsc2hs fork) is intended to solve this problem; have you looked into it? That may be good for the opengl-raw, I was working on generating Haskell modules from an XML spec - I crashed the thread with my own (similar) problems :-) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe