Re: [Haskell-cafe] Suppressing HLint on pattern match of files
Just add it next to -Wall wherever you‘re setting that, because I think you must be setting that yourself somewhere (it’s not on by default). On Thu, Oct 10, 2013 at 6:11 PM, Graham Berks gra...@fatlazycat.com wrote: Ah good point :) Wonder if I can change it on cabal file somehow. Thanks On 10 October 2013 at 14:05:45, Dag Odenhall (dag.odenh...@gmail.com//dag.odenh...@gmail.com) wrote: Is that actually from HLint though? I think that comes from GHC with -Wall and can be disabled with -fno-warn-missing-signatures. On Thu, Oct 10, 2013 at 7:50 AM, Graham Berks gra...@fatlazycat.comwrote: Hi, would like to disable 'Top-level binding with no type signature' In my test modules that are prefixed with Test. Is this possible ?? Thanks ___ 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] Suppressing HLint on pattern match of files
Is that actually from HLint though? I think that comes from GHC with -Walland can be disabled with -fno-warn-missing-signatures. On Thu, Oct 10, 2013 at 7:50 AM, Graham Berks gra...@fatlazycat.com wrote: Hi, would like to disable 'Top-level binding with no type signature' In my test modules that are prefixed with Test. Is this possible ?? Thanks ___ 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] ANN: E-book version of the Typeclassopedia
That's great — thank you! On Fri, Oct 4, 2013 at 3:13 PM, Erlend Hamberg ehamb...@gmail.com wrote: While re-reading Brent Yorgey's Excellent Typeclassopedia I converted it to Pandoc Markdown in order to be able to create an EPUB version. Having a “real” e-book meant that I could comfortably read it on my e-book reader and highlight text and take notes while reading. I also fixed some minor issues while reading it. (These fixes were of course backported to the official Typeclassopedia version on the Haskell Wiki.) The EPUB file can be downloaded from Github: https://github.com/ehamberg/typeclassopedia-md/releases The Markdown source is also available in that repo and you can of course use Pandoc to convert the Markdown file to all the other output formats Pandoc supports. By using a program like Calibre, the EPUB file can be converted to other e-book formats such as the Kindle format. I hope people find this useful. :-) -- Erlend Hamberg ehamb...@gmail.com ___ 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] Fwd: MVar problem in acid-state?
It's conceivable. It might help if you list what version of acid-stateyou're using and what parts of it. And maybe file a bug https://github.com/acid-state/acid-state/issues upstream even if you're not sure it is acid-state. On Mon, Sep 2, 2013 at 7:35 PM, Corentin Dupont corentin.dup...@gmail.comwrote: Hi the list, I have compiled my application on my PC, it works fine, but when I copy it on my server (same architecture), I get: Nomyx: thread blocked indefinitely in an MVar operation I don't use MVars in my application, is it possible that it's coming from acid-state? Thanks, Corentin ___ 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] reasons why Template Haskell does not propose something similar to Python exec() or eval()
There's a proposalhttp://ghc.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal#PartD:quasiquotationfor adding a proper Haskell QuasiQuoter as part of template-haskell. Until then, as others have noted your best option is the haskell-src-meta package, but be aware that this uses a separate parser. On Sat, Aug 24, 2013 at 11:36 AM, TP paratribulati...@free.fr wrote: Hi everybody, I continue to learn and test Template Haskell (one more time thanks to John Lato for his post at: http://www.mail-archive.com/haskell-cafe@haskell.org/msg106696.html that made me understand a lot of things). I have a question about the way Template Haskell is working. Why Template Haskell does not propose something similar to Python (or bash) exec() or eval(), i.e. does not offer the possibility to take a (quoted) string in input, to make abstract syntax in output (to be executed later in a splice $()). For example, in Python, to make an affectation 'a=a' programatically, I can simply do (at runtime; even if I am here only concerned with what Template Haskell could do, i.e. at compile time): def f(s): return '%s = \'%s\'' % (s,s) exec(f(a)) a 'a' With Template Haskell, I am compelled to make a function returning the abstract syntax corresponding to variable declaration: ValD (VarP $ mkName s) (NormalB $ LitE $ StringL s) (see complete example in Post Scriptum). This works fine, but it is less direct. I am sure that the Template Haskell approach has many advantages, but I am unable to list them. I think it is important to have the reasons in mind. Could you help me? Thanks in advance, TP PS: the complete Haskell example: --- module MakeVard where import Language.Haskell.TH makeVard :: Monad m = String - m [Dec] -- Equivalent to %s = \%s\ makeVard s = return [ ValD (VarP $ mkName s) (NormalB $ LitE $ StringL s) [] ] --- tested by --- {-# LANGUAGE TemplateHaskell #-} import MakeVard $(makeVard a) main = do print a --- resulting in $ runghc -ddump-splices test.hs test_makeVar.hs:1:1: Splicing declarations makeVard a == test_makeVar.hs:4:3-14 a = a a ___ 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] ANNOUNCE: haskell-src-exts 1.14.0
Good stuff! Is there any way, or plans for a way, to parse a file based on its LANGUAGE pragmas? Last I checked e.g. HSP simply enabled all extensions when parsing, which can cause code to be parsed incorrectly in some cases. On Tue, Aug 20, 2013 at 10:15 AM, Niklas Broberg niklas.brob...@gmail.comwrote: Fellow Haskelleers, I'm pleased to announce the release of haskell-src-exts-1.14.0! * On hackage: http://hackage.haskell.org/package/haskell-src-exts * Via cabal: cabal install haskell-src-exts * git repo: https://github.com/haskell-suite/haskell-src-extshttp://code.haskell.org/haskell-src-exts There are two primary reasons for this release, and a number of smaller ones. The first primary reason is technical: haskell-src-exts 1.14 revamps the Extension datatype, among other things to allow turning extensions on and off (similar to what Cabal allows). We also introduce the concept of a Language, separate from a set of extensions. This is the only backwards-incompatible change in this release. The second reason is structural: haskell-src-exts is now part of a larger context -- the Haskell Suite. The package has a new home on github (see above), alongside its new cool friends: haskell-names and haskell-packages. There is also a really nice issue tracker there - please help me fill it, or better yet, empty it! What this release does *not* cover is support for the extensions added to GHC in recent time (with the exceptions of CApiFFI and InterruptibleFFI). Work is in progress on many of these, and there will be another major release not far off in the future. This release owes many thanks to Roman Cheplyaka in particular, as well as Erik Hesselink, Simon Meier and David Fox. Thanks a lot! Complete changelog: 1.13.6 -- 1.14.0 === * Modernize the Extension datatype in L.H.E.Extension, following the lead of Cabal, to allow negative and positive extension modifiers (turning features on and off). You need to worry about backwards-incompatible changes if any of the following pertains to you: 1) If you use the Extension datatype programmatically - it has changed significantly (see documentation). 2) The ParseMode record now has one more field (baseLanguage :: Language), which might give you a type error. 3) The behavior of the (extensions :: [Extension]) field has changed, which could bite you if you pass custom extensions in the ParseMode. Previously, the ParseMode defaulted to the list of extensions accepted by Haskell2010, and if you set the list explicitly you would override this. Now, the defaults are { baseLanguage = Haskell2010, extensions = [] }, and explicitly setting a list of extensions will be interpreted on top of Haskell2010. See further the documentation for L.H.E.Extension. * Add support for the 'capi' calling convention. It is enabled with the CApiFFI extension. It's been included since GHC 7.4, and advertised since 7.6. * Add support for the 'interruptible' FFI safety annotation, enabled with the InterruptibleFFI extension. * Give better error message when lexing newline fails. In particular, fix the bug when the parser would crash if the file didn't end with a newline. * Support unboxed tuple expressions and patterns. * Fix bug in lexing of primitive integer literals in hex or octal notation. * Disallow negative primitive word literals (such as W# (-0x8000##)). * Allow phase control for SPECIALIZE pragma. * Derive Foldable and Traversable instances for all annotated AST types. * Fix bug with pretty-printing WARNING and DEPRECATED pragmas. Cheers, Niklas -- You received this message because you are subscribed to the Google Groups Haskell Server Pages group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-server-pages+unsubscr...@googlegroups.com. To post to this group, send email to haskell-server-pa...@googlegroups.com . Visit this group at http://groups.google.com/group/haskell-server-pages. For more options, visit https://groups.google.com/groups/opt_out. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 1.14.0
Well if you enable TemplateHaskell then code like foo$bar gets a new meaning and if you enable Arrows then proc is a reserved keyword, etc etc. On Tue, Aug 20, 2013 at 1:06 PM, Mateusz Kowalczyk fuuze...@fuuzetsu.co.ukwrote: On 20/08/13 11:56, Dag Odenhall wrote: Good stuff! Is there any way, or plans for a way, to parse a file based on its LANGUAGE pragmas? Last I checked e.g. HSP simply enabled all extensions when parsing, which can cause code to be parsed incorrectly in some cases. Can you give any examples of such cases? I had recently been asked about this and could not come up with much at all. -- Mateusz K. ___ 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] ANNOUNCE: haskell-src-exts 1.14.0
Wouldn't it be better to only enable Haskell2010 and XmlSyntax and then rely on LANGUAGE pragmas? I guess optimally we want to add support for -Xoptions to hsx2hs but in the mean time… BTW I think hsx2hs is in fact affected by these backwards-incompatible changes, and lacks an upper bound on its HSE dependency! Is hub.darcs.net the official location of the hsx2hs repository these days? On Tue, Aug 20, 2013 at 4:49 PM, Niklas Broberg niklas.brob...@gmail.comwrote: HSE parses based on pragmas by default. This can be configured through the ParseMode [1]. But your question regards HSP, Haskell Server Pages, which indeed just enables most extensions by default. Right now there's no way to configure that, but it shouldn't be hard for a skilled programmer to fix. Patches most welcome. :-) Cheers, Niklas [1] http://hackage.haskell.org/packages/archive/haskell-src-exts/1.13.5/doc/html/Language-Haskell-Exts-Parser.html#t:ParseMode On 20 Aug 2013 12:57, Dag Odenhall dag.odenh...@gmail.com wrote: Good stuff! Is there any way, or plans for a way, to parse a file based on its LANGUAGE pragmas? Last I checked e.g. HSP simply enabled all extensions when parsing, which can cause code to be parsed incorrectly in some cases. On Tue, Aug 20, 2013 at 10:15 AM, Niklas Broberg niklas.brob...@gmail.com wrote: Fellow Haskelleers, I'm pleased to announce the release of haskell-src-exts-1.14.0! * On hackage: http://hackage.haskell.org/package/haskell-src-exts * Via cabal: cabal install haskell-src-exts * git repo: https://github.com/haskell-suite/haskell-src-extshttp://code.haskell.org/haskell-src-exts There are two primary reasons for this release, and a number of smaller ones. The first primary reason is technical: haskell-src-exts 1.14 revamps the Extension datatype, among other things to allow turning extensions on and off (similar to what Cabal allows). We also introduce the concept of a Language, separate from a set of extensions. This is the only backwards-incompatible change in this release. The second reason is structural: haskell-src-exts is now part of a larger context -- the Haskell Suite. The package has a new home on github (see above), alongside its new cool friends: haskell-names and haskell-packages. There is also a really nice issue tracker there - please help me fill it, or better yet, empty it! What this release does *not* cover is support for the extensions added to GHC in recent time (with the exceptions of CApiFFI and InterruptibleFFI). Work is in progress on many of these, and there will be another major release not far off in the future. This release owes many thanks to Roman Cheplyaka in particular, as well as Erik Hesselink, Simon Meier and David Fox. Thanks a lot! Complete changelog: 1.13.6 -- 1.14.0 === * Modernize the Extension datatype in L.H.E.Extension, following the lead of Cabal, to allow negative and positive extension modifiers (turning features on and off). You need to worry about backwards-incompatible changes if any of the following pertains to you: 1) If you use the Extension datatype programmatically - it has changed significantly (see documentation). 2) The ParseMode record now has one more field (baseLanguage :: Language), which might give you a type error. 3) The behavior of the (extensions :: [Extension]) field has changed, which could bite you if you pass custom extensions in the ParseMode. Previously, the ParseMode defaulted to the list of extensions accepted by Haskell2010, and if you set the list explicitly you would override this. Now, the defaults are { baseLanguage = Haskell2010, extensions = [] }, and explicitly setting a list of extensions will be interpreted on top of Haskell2010. See further the documentation for L.H.E.Extension. * Add support for the 'capi' calling convention. It is enabled with the CApiFFI extension. It's been included since GHC 7.4, and advertised since 7.6. * Add support for the 'interruptible' FFI safety annotation, enabled with the InterruptibleFFI extension. * Give better error message when lexing newline fails. In particular, fix the bug when the parser would crash if the file didn't end with a newline. * Support unboxed tuple expressions and patterns. * Fix bug in lexing of primitive integer literals in hex or octal notation. * Disallow negative primitive word literals (such as W# (-0x8000##)). * Allow phase control for SPECIALIZE pragma. * Derive Foldable and Traversable instances for all annotated AST types. * Fix bug with pretty-printing WARNING and DEPRECATED pragmas. Cheers, Niklas -- You received this message because you are subscribed to the Google Groups Haskell Server Pages group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-server-pages+unsubscr...@googlegroups.com. To post to this group
Re: [Haskell-cafe] Does exist something like data-files in Cabal, which works at compile time?
You want extra-source-files. They'll be included in the tarball, and cabal always builds from the root of the package, so you can safely use relative paths. On Fri, Aug 16, 2013 at 11:58 AM, Alfredo Di Napoli alfredo.dinap...@gmail.com wrote: Hello guys, I'm pretty sure the answer is no, but I was hoping to get some extra insight / best practices. The problem can be summarised by this SO question (not the OP, but I have the same problem): http://stackoverflow.com/questions/15731170/cabal-how-to-add-text-file-as-a-build-dependency As someone states, data-files in for run-time, whereas I need to tell cabal please copy these files in place before trying to compile, so at compile-time. Does something similar exist? I think the best solution, unless someone prove me wrong, is to create a small startup script which copies the files for me (I *think* yesod is using something similar, namely a script called EmbeddedFiles.hs) and then triggers cabal install the usual way. Can you come up with a better way? Thanks in advance! Alfredo ___ 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] Alternative name for return
I particularly like she's (her?) syntax for Alternative. Not sure whether or not Idris has that. Applicative tuples would be nice too, something like (|a,b,c|) translating to liftA3 (,,) a b c. And operators too, liftA2 (+) a b as (| a + b |)? On Thu, Aug 15, 2013 at 11:08 AM, Erik Hesselink hessel...@gmail.comwrote: On Thu, Aug 15, 2013 at 5:39 AM, Jason Dagit dag...@gmail.com wrote: Also, if anyone wants to look at prior art first, Idris supports applicative brackets. As does she [0]. Erik [0] https://personal.cis.strath.ac.uk/conor.mcbride/pub/she/idiom.html ___ 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] Need advice: Haskell in Web Client
On Tue, 2012-01-17 at 22:05 +0300, dokondr wrote: On Tue, Jan 17, 2012 at 6:42 PM, John Lenz l...@math.uic.edu wrote: HTML5 Canvas is great for charts. If you go this route you might as well use a library which draws charts for you instead of writing all this code yourself. Personally, I use extjs version 4 which has some amazing charts, but there are other libraries out there. http://www.sencha.com/**products/extjs/examples/#**sample-3http://www.sencha.com/products/extjs/examples/#sample-3 Essentially the server provides the data in JSON or XML some other format, and the extjs code draws the charts on the client side. If you go with extjs, then the server side I would suggest a small, simple yesod or snap server. You could probably get the server under a hundred lines of code with yesod; see some of the examples in the yesod book. yesod or snap would serve JSON of the statistics on request, and also serve the javascript files which draw the charts. Yes, I was thinking about using Haskell to generate everything that specific Javascript library needs to display charts in browser. Naturally charts are to be displayed by this library itself. I also would like to have Haskell tools to generate Web GUI in Javascript. As for yesod, I am not sure that I like approach which mixes HTML with code, or even worse - creates a new weird HTML-like language like 'whamlet quasi-quotation', for example: !-- a href=@{Page1R}Go to page 1! -- I prefer using Turing complete PL to program web client, like the one used in GWT (Java) or Cappuccino (Objective-J). http://cappuccino.org/learn/ In this case you /almost/ don't need to know HTML, CSS, DOM, Ajax, etc. to develop WebUI and good PL lets you concentrate on problem domain instead of bothering about browser support. It is a real pity that Haskell still has no such tools to generate Web GUI in Javascript. ((( Have you seen Chris Done's posts on the subject? http://chrisdone.com/tags/javascript.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe