Re: [Haskell-cafe] A question regarding reading CPP definitions from a C header

2013-10-07 Thread Malcolm Wallace
If you use cpphs as a library, there is an API called runCpphsReturningSymTab. Thence you can throw away the actual pre-preprocessed result text, keep only the symbol table, and lookup whatever macros you wish to find their values. I suggest you make this into a little code-generator, to produ

Re: [Haskell-cafe] cpphs calls error when it finds an #error declaration

2013-08-28 Thread Malcolm Wallace
On 27 Aug 2013, at 08:33, Niklas Hambüchen wrote: > @Malcolm, would you mind a change towards throwing an exception that is > different from error so that it can be easily caught, or even better, a > change from > >runCpphs :: ... -> IO String > > to > >runCpphs :: ... -> IO (Either St

Re: [Haskell-cafe] Why GHC is written in Happy and not a monadic parser library?

2013-08-04 Thread Malcolm Wallace
On 3 Aug 2013, at 21:03, Jason Dagit wrote: > Another con of using parsec that I forgot to mention in my previous > email is that with Parsec you need to be explicit about backtracking > (use of try). Reasoning about the correct places to put try is not > always easy and parsec doesn't help you w

Re: [Haskell-cafe] Why GHC is written in Happy and not a monadic parser library?

2013-08-03 Thread Malcolm Wallace
On 3 Aug 2013, at 02:20, Jason Dagit wrote: >> Hi! >> Is there any specific reason why GHC is written in a parser GENERATOR >> (Happy) and not in MONADIC PARSER COMBINATOR (like parsec)? >> >> Is Happy faster / handles better errors / hase some great features or >> anything else? > > One reason

Re: [Haskell-cafe] "Casting" newtype to base type?

2013-07-01 Thread Malcolm Wallace
On 1 Jul 2013, at 16:07, Vlatko Basic wrote: > I had a (simplified) record > > data P = P { >a :: String, >b :: String, >c :: IO String >} deriving (Show, Eq) > > but to get automatic deriving of 'Show' and 'Eq' for 'data P' I have created > 'newtype IOS' and its 'Show' and 'E

Re: [Haskell-cafe] code to HTML

2013-06-03 Thread Malcolm Wallace
On 3 Jun 2013, at 20:38, Corentin Dupont wrote: > I'd like to transform a .hs file into a .html file. > The objective is that the .html file, when rendered, looks exactly the same > that the .hs, with the exeption that every function in the code is a link to > its haddock documentation. > Is th

Re: [Haskell-cafe] GSoC proposal: Haskell AST-based refactoring and API upgrading tool

2013-04-29 Thread Malcolm Wallace
On 29 Apr 2013, at 07:00, Niklas Hambüchen wrote: > I would like to propose the development of source code refactoring tool > that operates on Haskell source code ASTs and lets you formulate rewrite > rules written in Haskell. Seen this? http://www.haskell.org/haskellwiki/HaRe Regards, Mal

Re: [Haskell-cafe] Prolog-style patterns

2013-04-09 Thread Malcolm Wallace
On 9 Apr 2013, at 14:46, Sturdy, Ian wrote: > As far as the use of Eq goes, Eq is already enshrined in pattern matching by > pattern matching against literals. Not true. Pattern-matching literals explicitly avoids any use of Eq. Demonstration: data Foo = Foo | Bar instance Eq Foo where

Re: [Haskell-cafe] GSoC Project Proposal: Markdown support for Haddock

2013-04-08 Thread Malcolm Wallace
On 8 Apr 2013, at 14:52, Roman Cheplyaka wrote: >> In my opinion, it is perfectly valid to have intentional preprocessor >> directives inside Haskell comments. > > Could you give an example where this is useful? > ... macro expansions inside the comments are rather exotic. {- | Some module docu

Re: [Haskell-cafe] GSoC Project Proposal: Markdown support for Haddock

2013-04-08 Thread Malcolm Wallace
And cpphs strips C comments too. :-) But seriously, John's use-case is the exact opposite of what you suggest. John wants to keep the # inside the comment block. You suggest to remove the comment-block altogether? When I checked the example with cpphs, it turns out that the # line is retaine

haskell-cafe@haskell.org

2013-04-02 Thread Malcolm Wallace
On 1 Apr 2013, at 01:21, Seth Lastname wrote: > Note 2 says, "If the first token after a 'where' (say) is not indented more > than the enclosing layout context, then the block must be empty, so empty > braces are inserted." > > It seems that, in Note 2, the "first token" necessarily refers to

Re: [Haskell-cafe] cabal install ghc-mod installs 3 years old version

2013-03-01 Thread Malcolm Wallace
Doesn't Cabal tend to install library packages under the .cabal folder? So blowing it away gets rid of the problematic ones. (And everything else.) On 25 Feb 2013, at 16:56, Brent Yorgey wrote: > On Sun, Feb 24, 2013 at 02:33:55PM +, Niklas Hambüchen wrote: >> You are right, my "ghc-7.4.2"

Re: [Haskell-cafe] ANN: lazy-csv - the fastest and most space-efficient parser for CSV

2013-02-25 Thread Malcolm Wallace
On 25 Feb 2013, at 11:14, Oliver Charles wrote: > Obvious question: How does this compare to cassava? Especially cassava's > Data.CSV.Incremental module? I specifically ask because you mention that it's > " It is lazier, faster, more space-efficient, and more flexible in its > treatment of err

[Haskell-cafe] ANN: lazy-csv - the fastest and most space-efficient parser for CSV

2013-02-25 Thread Malcolm Wallace
There are lots of Haskell CSV parsers out there. Most have poor error-reporting, and do not scale to large inputs. I am pleased to announce an industrial-strength library that is robust, fast, space-efficient, lazy, and scales to gigantic inputs with no loss of performance. http://code.ha

[Haskell-cafe] Call for Nominations: Haskell Prime language committee

2013-02-04 Thread Malcolm Wallace
Dear Haskell lovers, The Haskell Prime process for standardisation of new versions of the Haskell language is at something of an impasse. Since the Haskell 2010 Report was issued (at the end of 2009), there has been very little momentum to formalise existing extensions and generalisations, nor

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-15 Thread Malcolm Wallace
On 15 Dec 2012, at 16:54, Michael Snoyman wrote: > I would strongly recommend reconsidering the licensing decision of cpphs. > Even if the LICENSE-commercial is sufficient for non-source releases of > software to be protected[1], it introduces a very high overhead for companies > to need to an

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-15 Thread Malcolm Wallace
On 13 Dec 2012, at 10:41, Petr P wrote: > In particular, we can have a BSD package that depends on a LGPL package, and > this is fine for FOSS developers. But for a commercial developer, this can be > a serious issue that is not apparent until one examines *every* transitive > dependency. Thi

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-15 Thread Malcolm Wallace
On 13 Dec 2012, at 18:40, Michael Snoyman wrote: > I'm not quite certain what to make of: > > If you have a commercial use for cpphs, and feel the terms of the (L)GPL > are too onerous, you have the option of distributing unmodified binaries > (only, not sources) under the terms of a different l

Re: [Haskell-cafe] education or experience?

2012-12-09 Thread Malcolm Wallace
On 9 Dec 2012, at 16:31, Doug McIlroy wrote: > In fact the FP community came late to some of these, just as > programming languages at large came late to garbage collection. > > Lazy evaluation--at the heart of spreadsheets since the beginning. Lazy evaluation for the lambda calculus - 1971 (W

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-07 Thread Malcolm Wallace
See also the incremental XML parser in HaXml, described in "Partial parsing: combining choice with commitment", IFL 2006. It has constant space usage (for some patterns of usage), even with extremely large inputs. http://www.google.co.uk/url?sa=t&rct=j&q=malcolm+wallace+part

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

2012-11-30 Thread Malcolm Wallace
For the record, it turned out that the key difference between the linux machines was the fonts packages installed via RPM. The strace utility told me that the crash happened shortly after cairo/pango attempted (and failed) to open some font configuration files. After installing some of the X11

Re: [Haskell-cafe] Survey: What are the more common Haskell IDEs in use ?

2012-11-24 Thread Malcolm Wallace
At my workplace, most people who code in Haskell use MS Visual Studio as their Haskell IDE. :-) But they don't read Haskell-cafe... Regards, Malcolm On 24 Nov 2012, at 07:28, Dan wrote: > Because I see there are many preferences on what IDE to use for Haskell > I've created a quick surve

Re: [Haskell-cafe] GHC maintenance on Arch

2012-10-29 Thread Malcolm Wallace
I think you will find that the Original Poster did not ask about ArchHaskell, but rather about Haskell on the Arch platform. He was completely unaware of ArchHaskell as a project. This might be a source of some confusion, and help to explain divergent attitudes. Regards, Malcolm On 29 Oc

Re: [Haskell-cafe] Optimal line length for haskell

2012-10-29 Thread Malcolm Wallace
It is kind of ironic that the wide code examples in the blog post are wrapped at 65 chars by the blog formatting. Regards, Malcolm On 29 Oct 2012, at 11:50, Rustom Mody wrote: > There was a recent discussion on the python list regarding maximum line > length. > It occured to me that beauti

Re: [Haskell-cafe] Either Monad and Laziness

2012-09-18 Thread Malcolm Wallace
On 12 Sep 2012, at 16:04, Eric Velten de Melo wrote: The behaviour I want to achieve is like this: I want the program when compiled to read from a file, parsing the PGM and at the same time apply transformations to the entries as they are read and write them back to another PG

Re: [Haskell-cafe] COBOL-85 parser, anyone?

2012-07-20 Thread Malcolm Wallace
Ralf Laemmel would probably be the world's foremost expert in parsing and analysing Cobol using functional languages. Try contacting him directly at uni-koblenz.de Some of his relevant papers: http://homepages.cwi.nl/~ralf/padl03/ http://homepages.cwi.nl/~ralf/ctp/ On 20 Jul 2012, at 10:08,

Re: [Haskell-cafe] Performance with do notation, mwc-random and unboxed vector

2012-06-11 Thread Malcolm Wallace
On 11 Jun 2012, at 10:38, Dmitry Dzhus wrote: > main = do > g <- create > e' <- VU.replicateM count $ standard g > return () In all likelhood, ghc is spotting that the value e' is not used, and that there are no side-effects, so it does not do anything at runtime. If you expand the action

Re: [Haskell-cafe] Generalizing (++) for monoids instead of using (<>)

2012-05-04 Thread Malcolm Wallace
On 4 May 2012, at 10:02, Alberto G. Corona wrote: > Restrict (++) String -> String -> String > > that locally would restrict the type within the module. import qualified Prelude import Prelude hiding ((++)) (++) :: String -> String -> String (++) = Prelude.(++) __

Re: [Haskell-cafe] Impact of "try" on Parsec performance

2012-03-03 Thread Malcolm Wallace
On 3 Mar 2012, at 04:30, Omari Norman wrote: > > On the other hand, I notice that attoparsec and polyparse backtrack by > default, and attoparsec claims to be faster than Parsec (I can't remember if > polyparse makes this claim). In my benchmarks, polyparse has about the same performance as Pa

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-08 Thread Malcolm Wallace
On 8/02/2012, at 14:16, Steve Horne wrote: > > I haven't given a lot of thought to updates. > I very much fail to see the point of replacing prefix function application with postfix dots, merely for field selection. There are already some imperfect, but adequate, solutions to the problem o

Re: [Haskell-cafe] FP activities and researchers in Warwickshire

2012-02-07 Thread Malcolm Wallace
"Fun in the afternoon", a termly gathering of UK FP people, will be in Oxford on 28th Feb. http://sneezy.cs.nott.ac.uk/fun/ On 7/02/2012, at 18:32, Ivan Perez wrote: > Hello, > I recently moved to Kenilworth, Warwickshire, UK, and I'd like > to know if there are meetings, talks, or any FP-rel

Re: [Haskell-cafe] strict version of Haskell - does it exist?

2012-01-30 Thread Malcolm Wallace
On 29 Jan 2012, at 22:25, Ertugrul Söylemez wrote: > A strict-by-default Haskell comes with the > implication that you can throw away most of the libraries, including the > base library. So yes, a strict-by-default Haskell is very well > possible, but the question is whether you actually want tha

Re: [Haskell-cafe] Can't install hspec

2012-01-23 Thread Malcolm Wallace
On 23 Jan 2012, at 07:01, Erik de Castro Lopo wrote: >/tmp/hspec-0.9.04062/hspec-0.9.0/Setup.lhs:2:10: >Could not find module `System' >It is a member of the hidden package `haskell98-2.0.0.0'. In ghc-7.2, you cannot use the haskell98 package in conjunction with the base pac

Re: [Haskell-cafe] [C][enums][newbie] What is natural Haskell representation of such enum?

2012-01-23 Thread Malcolm Wallace
> 2012/1/22 Данило Глинський > What is natural Haskell representation of such enum? > > enum TypeMask > { >UNIT, >GAMEOBJECT, > >CREATURE_OR_GAMEOBJECT = UNIT | GAMEOBJECT > }; I don't think that definition makes any sense in C, because UNIT is 0, so UNIT | GAMEOBJECT == GAMEOBJEC

Re: [Haskell-cafe] Tracing Prelude.read exceptions

2011-12-11 Thread Malcolm Wallace
I suggest switching from 'read' to a real parser that can give you proper error messages. I use Text.Parse from the polyparse package, which is designed to parse back exactly the format produced by derived Show instances. To derive the Parse class from your datatypes, the tool DRiFT is handy.

Re: [Haskell-cafe] HaXml 1.13 -> 1.22 upgrade

2011-12-11 Thread Malcolm Wallace
The extra parameter "i" is for "information" attached to each node of the tree. As you have correctly guessed, the parser fills in this field with positional information relating to the original source document, which is useful for instance if you are validating or checking the original documen

Re: [Haskell-cafe] Does anyone maintain trac.haskell.org?

2011-12-09 Thread Malcolm Wallace
>> 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 the

Re: [Haskell-cafe] GHCi and Cairo on Windows

2011-12-05 Thread Malcolm Wallace
On Windows, it is necessary to add to your PATH variable the bin directory where the gtk+ DLL lives. Note, this is the C DLL, not the Haskell one produced by gtk2hs. For instance, on my machine the relevant directory is C:\workspace\ext\gtk+-2.20\bin. It is quite likely different on yours.

Re: [Haskell-cafe] Hackage down!

2011-12-01 Thread Malcolm Wallace
And, amusingly, http://downforeveryoneorjustme.com/ is also down, having exceeded its Google App Engine quota. [ But the similarly named .org site still works, and confirms that hackage is down. ] Regards, Malcolm ___ Haskell-Cafe mailing list H

Re: [Haskell-cafe] Superset of Haddock and Markdown

2011-11-21 Thread Malcolm Wallace
On 20 Nov 2011, at 22:20, Ivan Lazar Miljenovic wrote: > On 21 November 2011 03:19, David Fox wrote: >> On Fri, Nov 18, 2011 at 1:10 AM, Ertugrul Soeylemez wrote: >>> Ivan Lazar Miljenovic wrote: >>> Wasn't there talk at one stage of integrating pandoc into haddock? >>> >>> I wouldn't m

Re: [Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-30 Thread Malcolm Wallace
> The problem isn't social pressure to be stable, it's the ambiguity of what > "stable" means. If Hackage 2 institutes a policy whereby things claiming to > be stable are treated better, then "stable" is likely to become the new > "experimental". I'd say, rather than rely on social agreement o

Re: [Haskell-cafe] Fwd: how to increase the stack size

2011-10-17 Thread Malcolm Wallace
>> when I am running the program in my terminal on ubuntu its showing me >> GHC stack-space overflow: current limit is 536870912 bytes. >> Use the `-K' option to increase it. >> how can i increase the stack sizePlz help me out > > > Others have explained how to "Use the `-K' option", Ho

Re: [Haskell-cafe] Is it possible to represent such polymorphism?

2011-10-03 Thread Malcolm Wallace
> Although I still wonder why something so simple in C++ is actually more > verbose and requires less known features in Haskell...What was the design > intent to disallow simple overloading? The "simple" C++ overloading you want to add to Haskell, is in fact rather semantically complex, and it

Re: [Haskell-cafe] mapM is supralinear?

2011-09-27 Thread Malcolm Wallace
On 27 Sep 2011, at 11:23, Arseniy Alekseyev wrote: > Malcolm, one should amortize the cost of the collection over the > amount of free space allocated rather than recovered They are the same thing. You can only allocate from the space that has been recovered. It is true that generational GC h

Re: [Haskell-cafe] mapM is supralinear?

2011-09-27 Thread Malcolm Wallace
On 26 Sep 2011, at 23:14, Arseniy Alekseyev wrote: > Garbage collection takes amortized O(1) per allocation, doesn't it? No. For Mark-Sweep GC, the cost is proportional to (H+R) / (H-R) where H is the total heap size R is the reachable (i.e. live) heap This formula amortises the cost of

Re: [Haskell-cafe] Categorized Weaknesses from the State of Haskell 2011 Survey

2011-09-13 Thread Malcolm Wallace
On 13 Sep 2011, at 18:59, Michael Orlitzky wrote: >> Malcolm Wallace and Colin Runciman's ICFP99 paper functioned well as a >> tutorial for HaXml when I used it - maybe it is a bit out of date now? >> HaXml is hardly a dire case. > > The paper is out-of-date, so it

Re: [Haskell-cafe] partial inheritance

2011-07-19 Thread Malcolm Wallace
On 19/07/2011, at 0:09, Patrick Browne wrote: > instance Bird Emperor where > -- No fly method > walk x y = y > > instance Penguin Emperor where > -- How can I override the walk method in the instance Penguin? > -- walk x y = x Why would you want to override the walk method for Emperor?

Re: [Haskell-cafe] Inconsistent trailing comma in export list and record syntax

2011-07-11 Thread Malcolm Wallace
> That just shifts the problem, I think? Now you can no longer comment out the > first line. If you are using to-end-of-line comments with --, then the likelihood of noticing a leading ( or { on the line being commented, is much greater than the likelihood of noticing a trailing comma on the

Re: [Haskell-cafe] Data.Time

2011-07-03 Thread Malcolm Wallace
On 2 Jul 2011, at 22:13, Yitzchak Gale wrote: > [1]http://hackage.haskell.org/package/timezone-series > [2]http://hackage.haskell.org/package/timezone-olson I'd just like to add that these timezone packages are fantastic. They are extremely useful if you need accurate conversion between wall-c

Re: [Haskell-cafe] Patterns for processing large but finite streams

2011-07-01 Thread Malcolm Wallace
Sure you can. runningAverage :: Int -> [Double] -> [Double] runningAverage n xs = let chunk = take n xs in (sum chunk / length chunk) : runningAverage (tail xs) Lazy lists are absolutely ideal for this purpose. Regards, Malcolm On 1 Jul 2011, at 07:33, Eugene Kirpichov

Re: [Haskell-cafe] Data.Time

2011-06-26 Thread Malcolm Wallace
On 26 Jun 2011, at 01:53, Tony Morris wrote: > Having only had a flirt with Data.Time previously, I assumed > it would be robust like many other haskell libraries. If, by lack of robustness, you mean that you get runtime errors, then consider them bugs, and file them with the author/maintainer

Re: [Haskell-cafe] Alex Lexer Performance Issues

2011-06-26 Thread Malcolm Wallace
On 22 Jun 2011, at 15:53, Tristan Ravitch wrote: > On Wed, Jun 22, 2011 at 07:48:40AM +0100, Stephen Tetley wrote: >> How fast is good old String rather than ByteString? >> >> For lexing, String is a good fit (cheap deconstruction at the head / >> front). For your particular case, maybe it loses

Re: [Haskell-cafe] Why aren't there anonymous sum types in Haskell?

2011-06-21 Thread Malcolm Wallace
On 21 Jun 2011, at 20:53, Elliot Stern wrote: > A tuple is basically an anonymous product type. It's convenient to not have > to spend the time making a named product type, because product types are so > obviously useful. > > Is there any reason why Haskell doesn't have anonymous sum types?

Re: [Haskell-cafe] Haskell *interpreter* on iPad? (Scheme and Ocaml are there)

2011-06-19 Thread Malcolm Wallace
On 18 Jun 2011, at 20:19, Jack Henahan wrote: > but the dev would either be forced into Hugs, or they'd have to implement a > more portable GHC. Does such a thing exist already? Just as a point of interest, the original nhc compiler was original written for an ARM architecture machine (Acorn A

Re: [Haskell-cafe] location of IEEE Viz code ?

2011-06-12 Thread Malcolm Wallace
> http://hackage.haskell.org/trac/PolyFunViz/wiki/IEEEVisCode > > talks about the code being available through darcs but I can't seem to put my > hands on the http address I would need to pull the code. > > This is all relating to the paper, "Huge Data but Small Programs: > Visualization Design

Re: [Haskell-cafe] SIGPLAN Programming Languages Software Award

2011-06-09 Thread Malcolm Wallace
> Curious observation: > >Object languageType language >OO (C++)functional >functional (Haskell)logical > > It makes me wonder what comes next... To be more accurate, it was Functional Dependencies that introduced a logic programming language to the

Re: [Haskell-cafe] Type Constraints on Data Constructors

2011-06-08 Thread Malcolm Wallace
> data Bar f a = Foo f => Bar {bar :: f a} The class context on the data constructor buys you nothing extra in terms of expressivity in the language. All it does is force you to repeat the context on every function that uses the datatype. For this reason, the language committee has decided t

Re: [Haskell-cafe] SIGPLAN Programming Languages Software Award

2011-06-08 Thread Malcolm Wallace
> More seriously, the influence of Haskell over F# (and even Python) is > undoubted, but do you really think Haskell influenced Java Generics? (IMHO > they were more inspired from C++ templates) > (That is a question, not an assertion). Phil Wadler had a hand in designing both Haskell and Java

Re: [Haskell-cafe] How to install GhC on a Mac without registering?

2011-06-06 Thread Malcolm Wallace
On 6 Jun 2011, at 13:49, Lyndon Maydwell wrote: > I would be fantastic if XCode wasn't a dependency. ... > > Not to detract at all from the work of the wonderful GHC and Haskell > Platform contributors in any way. For me it would just make it that > much easier to convince mac-using friends to

Re: [Haskell-cafe] How to install GhC on a Mac without registering?

2011-06-06 Thread Malcolm Wallace
> it won't be a pleasant choice to fork over a good chunk of money to > Apple for the use of free software that they didn't develop. Whilst I acknowledge your painful situation, I'd like to rebut the idea that Apple stole someone else's free software and are selling it on. In fact, Apple develo

Re: [Haskell-cafe] Fwd: Abnormal behaviors when Using ghci

2011-06-05 Thread Malcolm Wallace
On 5/06/2011, at 13:12, 吴兴博 wrote: > 1) I'm using Haskell platform 2011.2 on windows (7). Every several > days, ghci will crash with no messages. even when I'm just typing with > text buffer, without an 'enter'. I got nothing after the crash, not > even an exception code, don't even mention the c

Re: [Haskell-cafe] Matplotlib analog for Haskell?

2011-06-03 Thread Malcolm Wallace
> I tried gnuplot: > > Demo.hs:25:18: > Could not find module `Paths_gnuplot': > Use -v to see a list of the files searched for. > Failed, modules loaded: none. > Prelude Graphics.Gnuplot.Simple> > > > Where to get `Paths_gnuplot': module? $ cd gnuplot-0.4.2 $ cabal install # this ge

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Malcolm Wallace
>> -- followed by a symbol does not start a comment, thus for example, haddock >> declarations must begin with -- |, and not --|. >> >> What might --| mean, if not a comment? It doesn't seem possible to define it >> as an operator. > > GHCi, at least, allows it. > > Prelude> let (--|) = (+) > Pr

Re: [Haskell-cafe] What's the advantage of writing Haskell this way?

2011-05-30 Thread Malcolm Wallace
instance (Monad m, MonadPlus m) => Monoid (Stream m a) where > mempty = Chunks mempty > mappend (Chunks xs) (Chunks ys) = Chunks (xs `mappend` ys) > mappend _ _ = EOF > > > Iteratee.hs:28:25: > No instance for (Monoid (m a)) > arising from a use of `mempty' > There

Re: [Haskell-cafe] [Maybe Int] sans Nothings

2011-05-23 Thread Malcolm Wallace
On 23 May 2011, at 17:20, michael rice wrote: > What's the best way to end up with a list composed of only the Just values, > no Nothings? Alternatively, [ x | Just x <- originals ] It also occurs to me that perhaps you still want the Just constructors. [ Just x | Just x <- origi

Re: [Haskell-cafe] [Maybe Int] sans Nothings

2011-05-23 Thread Malcolm Wallace
On 23 May 2011, at 17:20, michael rice wrote: > What's the best way to end up with a list composed of only the Just values, > no Nothings? Go to haskell.org/hoogle Type in "[Maybe a] -> [a]" Click on first result. ___ Haskell-Cafe mailing list Haskell-

Re: [Haskell-cafe] Using cmake with haskell

2011-05-15 Thread Malcolm Wallace
> On 5/14/11 6:12 PM, Nathan Howell wrote: >> Waf supports parallel builds and works with GHC without too much trouble. I'm surprised no-one has yet mentioned Shake, a build tool/library written in Haskell. It does parallel builds, multi-language working, accurate dependencies, etc etc. I use

Re: [Haskell-cafe] cannot install base-4.3.1.0 package

2011-05-15 Thread Malcolm Wallace
On 15 May 2011, at 15:35, Immanuel Normann wrote: > Why is it so complicated to install the base package? You cannot upgrade the base package that comes with ghc. It's a bad design, but there we go. Regards, Malcolm ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] no time profiling on my MacBookPro8,1

2011-05-08 Thread Malcolm Wallace
On 6 May 2011, at 23:07, Nicolas Frisby wrote: > all of the %time cells in the generated Main.prof file are 0.0, as is > the total time count (0.00 secs and 0 ticks). The %alloc cells seem > normal. See http://hackage.haskell.org/trac/ghc/ticket/5137 Regards, Malcolm _

Re: [Haskell-cafe] How often is the planet updated?

2011-05-05 Thread Malcolm Wallace
On 28 Apr 2011, at 11:26, Magnus Therning wrote: > I see that Planet Haskell hasn't been updated since April 26. Is > something wrong with it, or does it really not update more often than > that? Just to note: there was a configuration problem with planet, which has now been sorted out. The u

Re: [Haskell-cafe] Python is lazier than Haskell

2011-04-29 Thread Malcolm Wallace
On 29 Apr 2011, at 05:38, Ben Lippmeier wrote: > Laziness at the value level causes space leaks, This is well-worn folklore, but a bit misleading. Most of my recent space leaks have been caused by excessive strictness. Space leaks occur in all kinds of programs and languages, and I am not c

Re: [Haskell-cafe] converting prefixes of CString <-> String

2011-04-26 Thread Malcolm Wallace
On 26 Apr 2011, at 13:31, Eric Stansifer wrote: >>> Let 'c2h' convert CStrings to Haskell Strings, and 'h2c' convert >>> Haskell Strings to CStrings. (If I understand correctly, c2h . h2c >>> === id, but h2c . c2h is not the identity on all inputs; >> >> That is correct. CStrings are 8-bits, a

Re: [Haskell-cafe] A small Darcs anomoly

2011-04-26 Thread Malcolm Wallace
On 25 Apr 2011, at 11:13, Andrew Coppin wrote: > On 24/04/2011 06:33 PM, Jason Dagit wrote: >> >> This is because of a deliberate choice that was made by David Roundy. >> In darcs, you never have multiple branches within a single darcs >> repository directory tree. > > Yes, this seems clear. I'

Re: [Haskell-cafe] converting prefixes of CString <-> String

2011-04-26 Thread Malcolm Wallace
On 25 Apr 2011, at 08:16, Eric Stansifer wrote: > Let 'c2h' convert CStrings to Haskell Strings, and 'h2c' convert > Haskell Strings to CStrings. (If I understand correctly, c2h . h2c > === id, but h2c . c2h is not the identity on all inputs; That is correct. CStrings are 8-bits, and Haskell S

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-03-14 Thread Malcolm Wallace
On 22 Feb 2011, at 22:21, Bryan O'Sullivan wrote: for some code that's (b) faster than anything else currently available I look forward to seeing some benchmarks against libraries other than containers, such as AVL trees, bytestring-trie, hamtmap, list-trie, etc. Good comparisons of diff

Re: [Haskell-cafe] A simple attoparsec question

2011-03-03 Thread Malcolm Wallace
On 1 Mar 2011, at 21:58, Evan Laforge wrote: parseConstant = Reference <$> try parseLocLabel <|> PlainNum <$> decimal <|> char '#' *> fmap PlainNum hexadecimal <|> char '\'' *> (CharLit <$> notChar '\n') <* char '\'' <|> try $ (char '"' *> (S

Re: [Haskell-cafe] Where to put a library

2011-03-02 Thread Malcolm Wallace
On 2 Mar 2011, at 22:38, Sebastian Fischer wrote: You could place the parsers under Text.TSPLIB Text.SATLIB Text Some other suggestions might be Codec.TSP Codec.SAT or FileFormat.TSP FileFormat.SAT Regards, Malcolm

Re: [Haskell-cafe] [Cabal-devel] Cabal && license combinations

2011-02-10 Thread Malcolm Wallace
On 10 Feb 2011, at 17:38, Antoine Latter wrote: So no, the instant of compilation is not when the transitive dependencies kick in, it is the publication of compiled binaries, which in my mind is a pretty specialized case. This is possibly the most important point to emphasise, of which many

Re: [Haskell-cafe] Cabal && license combinations

2011-02-07 Thread Malcolm Wallace
It seems then that a package should be the least restrictive combination of all the licenses in all the contained modules. Omit the words "least restrictive" and I think you are correct. To combine licences, just aggregate them. There is no lattice of subsumption; no "more" or "less" restri

Re: [Haskell-cafe] coding style vs. foreign interfaces

2011-02-07 Thread Malcolm Wallace
On 7 Feb 2011, at 03:10, Donn Cave wrote: I just noticed a handful of spelling errors, in a package that isn't all that obscure. Enums from a C interface - data AlarmingNews = -- ALARM_STUFF_WENT_WRONG AlarmStufWentWrong | ... FWIW, if you generate these bindings with a tool (e.g. hsc2

Re: [Haskell-cafe] Delivery to haskell-platf...@projects.haskell.org

2011-01-23 Thread Malcolm Wallace
but I assumed that had already been resolved and that I was seeing another failure, but apparently not :-( Hopefully it'll be resolved soon. If anyone with sysadmin experience on Debian can suggest why "telnet localhost 25" hangs on community.haskell.org, even though both exim and clamd a

Re: [Haskell-cafe] Haskell time line?

2011-01-20 Thread Malcolm Wallace
On 20 Jan 2011, at 14:40, michael rice wrote: Maybe a better question would be which of these features, *weren't* present at first launch? The only obvious feature that was missing in 1990 was monads (at least built-in support for them). Do-notation for instance was first introduced by M

Re: [Haskell-cafe] Misleading MVar documentation

2011-01-16 Thread Malcolm Wallace
On 16 Jan 2011, at 03:58, Jan-Willem Maessen wrote: Actually, the first presentation of M-structures is rather older than that. See Barth, Nikhil, and Arvind's FPCA '91 paper: http://portal.acm.org/citation.cfm?id=652538 The original formulation was indeed in terms of "take" and "put", though

Re: [Haskell-cafe] Odd profiling results

2011-01-04 Thread Malcolm Wallace
http://www.mega-nerd.com/tmp/ddc-heap-usage-20101231.png We have no particular problem with the 11 peaks (one for each source file) but wonder what the hell is going on in the periods when the memory usage is flat. The peaks I am guessing are largely attributable to parsing the source file

Re: [Haskell-cafe] GHC ParseTree Module

2011-01-03 Thread Malcolm Wallace
You will be more likely to get an answer on the ghc-users mailing list (cc'ed). The ghc developers rarely follow -cafe. On 1 Jan 2011, at 20:36, Jane Ren wrote: Hi, Does anyone know what GHC module gets the AST and type info of some source code? This is the GHC module that converts all o

Re: [Haskell-cafe] Haskell Parse Tree

2010-12-21 Thread Malcolm Wallace
The haskell-src-exts package? http://hackage.haskell.org/package/haskell-src-exts On 21 Dec 2010, at 09:35, Serguey Zefirov wrote: 2010/12/21 Jane Ren : Does anyone know how to get the parse tree of a piece of Haskell code? Any recommended documentation? ghc as a library? http://www.h

Re: [Haskell-cafe] Fwd: typehash patch for base >= 4 && < 4.4

2010-12-02 Thread Malcolm Wallace
I sent a patch to fix this to the maintainer for the typehash package (Lennart Augustsson) on the 16th of November, but haven't heard anything back - it is possible that he doesn't read the e-mail address I sent it to, or is no longer interested in maintaining typehash. Lennart applied yo

[Haskell-cafe] Re: Re: Reply-To: Header in Mailinglists

2010-11-21 Thread Malcolm Wallace
If the mailing list replaced Reply-To header it would required additional effort for responders instead of just pressing reply-to- all. If the list were to add a "Reply-To:" header, but only in the case where one was not already present, that would seem to me to be ideal. (None of the inte

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-12 Thread Malcolm Wallace
On 12 Nov 2010, at 20:21, Andrew Coppin wrote: On 11/11/2010 08:43 PM, Richard O'Keefe wrote: If length, map, and so on had always been part of a Sequence typeclass, people would not now be talking about It's always puzzled me that Haskell's standard containers almost completely lack any w

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-11 Thread Malcolm Wallace
The point is that refusing something you can have now (though of course it's an open question whether TDNR is something we can "have now") out of fear that it'll prevent you getting something better later is speculative and often backfires. I think we are very far from having TDNR "now". It is

Re: [Haskell-cafe] Serialization of (a -> b) and IO a

2010-11-11 Thread Malcolm Wallace
I'll just note that LLVM is only platform independent to a degree. Or rather, I believe the situation is that it *is* architecture independent, but it doesn't abstract anything else besides the architecture In particular, imagine how you might serialise a Haskell function which is an FFI bindi

[Haskell-cafe] Re: Haskell on ancient machines (Was: "Haskell is a scripting language inspired by Python.")

2010-11-05 Thread Malcolm Wallace
I haven't checked how much RAM nhc98 needs for bootstrapping recently, but the Makefile suggests 16Mb of heap + 2Mb of stack is more than sufficient - it could probably manage with less. If it was possible to save resources in these days - why isn't it possible today anymore? Too many Haskel

Re: [Haskell-cafe] Re: "Haskell is a scripting language inspired by Python."

2010-11-05 Thread Malcolm Wallace
On 5/11/2010, at 8:54 AM, Andrew Coppin wrote: Can you actually run something like Haskell with mere kilobytes of RAM? I recall running Haskell-like programs (compiled by Gofer, the predecessor of Hugs) on a machine with 256Kb of memory, back in the early 1990s. They were smallish program

Re: [Haskell-cafe] Re: "Haskell is a scripting language inspired by Python."

2010-11-04 Thread Malcolm Wallace
On 4 Nov 2010, at 22:38, Lennart Augustsson wrote: The smallest bootstrapped Haskell compiler is NHC which (I think) runs in a few MB. Originally, it needed to be able to compile itself in the 2Mb available on Niklas's Amiga. Then he got an upgrade to 4Mb, so he started to become less dis

Re: [Haskell-cafe] What is simplest extension language to implement?

2010-11-04 Thread Malcolm Wallace
On 4 Nov 2010, at 17:52, Luke Palmer wrote: On Thu, Nov 4, 2010 at 5:30 AM, Malcolm Wallace > wrote: ehm. I missed something and ghc api is well documented and stable ? There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. Do tell. Well,

Re: [Haskell-cafe] What is simplest extension language to implement?

2010-11-04 Thread Malcolm Wallace
ehm. I missed something and ghc api is well documented and stable ? There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. It is inacceptable for scripting language, faced to no-programmers. Such languages must be as plain and regular, as possible.

Re: [Haskell-cafe] "Haskell is a scripting language inspired by Python."

2010-11-04 Thread Malcolm Wallace
Did Haskell get significant whitespace from Python - doubtful as Python possibly wasn't visible enough at the time, but you never know. Whitespace is significant in almost every language: foo bar /= foobar. Using indentation for program structuring was introduced by Peter Landin in his ISWIM

Re: [Haskell-cafe] Parsing workflow

2010-10-31 Thread Malcolm Wallace
- Is this a valid approach? It is possible that your Parsec lexer will need to see the entire input before it delivers any tokens at all to the Happy parser. This might cause a space problem, depending on how large your inputs are likely to be. - What is your workflow on parsing comple

Re: [Haskell-cafe] Parsing workflow

2010-10-31 Thread Malcolm Wallace
On 31 Oct 2010, at 16:15, Nils Schweinsberg wrote: Am 31.10.2010 16:53, schrieb Vo Minh Thu: So you have to either factorize you parsers or use the 'try'. This is exactly what gives me headaches. It's hard to tell where you need try/lookAhead and where you don't need them. And I don't rea

Re: [Haskell-cafe] New repo location for the network package

2010-10-28 Thread Malcolm Wallace
if I could move to darcs and preserve history I would. Search for "git fastexport" and "darcs-fastconvert". Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

  1   2   3   4   5   >