Re: [Haskell-cafe] Refactoring status

2008-01-03 Thread Neil Mitchell
Hi PS: IMHO I don't think text should be the source format of our files… I think we should use a standarized decorated AST as the source, from which we can derive a textual (but also graphical) view and editor… Any comments on that? J Yes - I think you're wrong. I've seen non-textual editors

Re: [Haskell-cafe] Escape Codes

2008-01-02 Thread Neil Mitchell
Hi Some days ago I needed escape codes on Win32. I didn't find any library for that, so I wrote a simple one. I have a simple module which does them as part of Hoogle: http://www.cs.york.ac.uk/fp/darcs/hoogle/src/General/Type.hs - see TagStr, the type for defining text with basic formatting

[Haskell-cafe] Hackage web page

2008-01-02 Thread Neil Mitchell
Hi, The hackage web page confuses me: http://hackage.haskell.org/packages/hackage.html As a user, when I go to that page, I would be seeking one of four pieces of information: 1) How to install a cabal package 2) How to create and upload a cabal package 3) What packages are on hackage 4)

Re: [Haskell-cafe] Compiler backend question

2008-01-01 Thread Neil Mitchell
Hi If I understand it correctly, the GHC compiler either directly generates machinecode, or it uses C as an intermediate language. I also read somewhere that C is not the most efficient intermediate representation for functional languages, and that one gets better performance when

. defined in GHC and System.FilePath

2007-12-31 Thread Neil Mitchell
Hi The GHC API uses the . operator, which clashes with System.FilePath. Possibly this might want renaming to something else - I have absolutely no idea what it does! Prelude :m GHC Prelude GHC :i . (.) :: HsWrapper - HsWrapper - HsWrapper-- Defined in HsBinds Thanks Neil

Redefining built in syntax

2007-12-31 Thread Neil Mitchell
Hi, I'm getting errors such as: C:/Documents/Uni/packages/base/GHC/Base.lhs:270:12: Illegal binding of built-in syntax: [] When I try and compile GHC/Base.lhs using the GHC API. Is there some flag I can pass to allow the rebinding of built in syntax? Thanks Neil

Re: External Core - my goal

2007-12-28 Thread Neil Mitchell
Hi 2) Compile all the associate libraries and modules to generate separate GHC Core files for each. Convert each Core file to Yhc Core. Link the Yhc Core files together. Now that I've read this more carefully -- I think plan (2) is your best bet. In theory, you should be able to do (2)

Re: [Haskell] Empty instance declaration

2007-12-28 Thread Neil Mitchell
Hi The trouble, of course, is that classes could have rather complicated minimum instance requirements. Still, if someone came up with a decent syntax such as (but better than) You don't need a syntax, the information is already there. You also don't need to do complicated non-termination

External Core - my goal

2007-12-26 Thread Neil Mitchell
Hi Tim, Since you've now checked in External Core, I thought I'd ask how close we are to my ideal use case of External Core. My goal is to use External Core with Catch (http://www-users.cs.york.ac.uk/~ndm/catch/). To be able to use GHC Core with Catch, it is necessary to be able to do one of two

Re: [Haskell-cafe] Re: CAF's in Haskell

2007-12-26 Thread Neil Mitchell
Hi Are CAF's specified in the Haskell report? I couldn't find them mentioned. CAF is a term of art. If you define fred = 2 + 2 that's a CAF. I should have been more precise with my question. Given the code: fred = 2 + 2 bob = fred + fred In a Haskell implementation fred would be

Re: [Haskell-cafe] FW: Treating command-line arguments as a Haskell expression

2007-12-24 Thread Neil Mitchell
Hi I want to call a function from within Haskell module so that the name of this function corresponds to my first command-line argument and the rest rest of the command-line arguments are would become themselves the argument to this function. While you can do this, you probably don't

Re: whole program optimization

2007-12-23 Thread Neil Mitchell
Hi Isaac, I've had similar thoughts before. Once GHC can read and write external Core this should become a half hour hack. I did a similar thing in Yhc, and it really is trivial (http://darcs.haskell.org/yhc/src/compiler98/Core/Linker.hs). I'm sure there would be a few corner cases, but those

Re: [Haskell-cafe] A Foldable binary search tree

2007-12-23 Thread Neil Mitchell
Hi Brad, Experience has taught me to _never_ put class contexts on data definitions. Now you can't write something as simple as Empty - you have to give it a class context. This is just plain annoying. With the class context in the BST definition, ghc gives no complaints when I evaluate

Re: [Haskell-cafe] Comments on reading two ints off Bytestring

2007-12-23 Thread Neil Mitchell
Hi parseHeader $ BS.pack hello 252 359 (252,359) If this were strings, I'd start with: map read . words If you want to have error correction, I'd move to: mapM readMay . words (readMay comes from the safe package, http://www-users.cs.york.ac.uk/~ndm/safe/) I don't know about the

Re: [Haskell-cafe] Hoogle search scope question -- was: [HXT] Simple question

2007-12-22 Thread Neil Mitchell
Hi I have a hoogle question. While I was reading the HXT discussion (below), I tried to search runX and readString in Hoogle (since I am new to HXT and Arrows). But neither search yielded any result and I had to use google to find the Haskell docs. So I am wondering what is the scope of

Re: [Haskell-cafe] Re: Importing Data.Char speeds up ghc around 70%

2007-12-22 Thread Neil Mitchell
Hi Yes - the same difference: 1.33 minutes vs. 2.30 now. I was near at reporting this as a bug, but rejected that idea. What does bug mean here ? If it can be reproduced on anyones machine, it is a bug. If you can bundle up two programs which don't read from stdin (i.e. no getLine calls) or

Re: How to use #ifdef WIN32

2007-12-20 Thread Neil Mitchell
Hi Jim I want to switch code on the OS but this always goes through to the #else (on windows or elsewhere): {-# OPTIONS -cpp #-} #ifdef WIN32 main = putStrLn hello windows #else main = putStrLn hello something else #endif Does this depend on a Makefile setting WIN32, or should there be

Re: [Haskell-cafe] Dynamic typing of polymorphic functions

2007-12-19 Thread Neil Mitchell
Hi OK, If you managed to read until this point, you might have noticed that, due to the monomorphism restriction implied by Data.Typeable, it is impossible to build polymorphic processes. Tom Shackell had similar issues with passing code around at runtime. As a result Yhc contains the

Re: [Haskell-cafe] How to make Prelude.read: no parse more verbose ...

2007-12-19 Thread Neil Mitchell
Hi Well, how do I compile a Haskell program in such a way, that I get a useful error message from read? I mean, like the filename/linenumber of the calling expression for starters. I use the Safe library to do this sort of stuff: http://www-users.cs.york.ac.uk/~ndm/safe/ You can call

Re: [Haskell-cafe] Knowledge

2007-12-19 Thread Neil Mitchell
Hi contains :: Eq a = [a]-a-Bool contains [] e = False contains (x:xs) e = if x==e then True else contains xs e contains = flip elem And even if not using the elem function, the expression: if x==e then True else contains xs e can be written as: x==e || contains xs e Thanks Neil

GADT pattern match in non-rigid context

2007-12-17 Thread Neil Mitchell
Hi, Upgrading from GHC 6.6 to 6.8 has caused some code to stop working: -- {-# OPTIONS_GHC -fglasgow-exts #-} module Data2 where data CCompany data Paradise :: * - * where CC :: Paradise CCompany rewrapCC CC = []

Re: GADT pattern match in non-rigid context

2007-12-17 Thread Neil Mitchell
Hi Simon, You should be giving a type signature to rewrap! That should fix it. Thanks, all works fine now :-) Neil | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of | Neil Mitchell | Sent: 17 December 2007 16:23 | To: glasgow-haskell-users

Re: [Haskell-cafe] #haskell works

2007-12-15 Thread Neil Mitchell
Hi No-one is writing a commercial Haskell compiler yet (although there is at least one commercial Haskell-like language). What I mean is, the amount of commercial-oriented funding spent on GHC (as opposed to the research-oriented funding spent by Microsoft Research and various research

Re: where's the best place to post those really irratating noddy questions that people who are learning Haskell ask.....

2007-12-14 Thread Neil Mitchell
[EMAIL PROTECTED] On 12/14/07, Nicholls, Mark [EMAIL PROTECTED] wrote: ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: [Haskell-cafe] Hoogle error

2007-12-14 Thread Neil Mitchell
Hi Hi. Sorry, I should have put the question differently -- is there sometimes a need to escape hoogle input (i.e. so I could confirm there were no results, rather than getting an error)? The only one I'm aware of is that searching for any operator such as (+) needs to be done without

Re: [Haskell-cafe] Data.Generics: how do I get the type name of a value?

2007-12-14 Thread Neil Mitchell
Hi http://haskell.org/hoogle/?q=typeOf C:\ghci GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude :m Data.Typeable Prelude Data.Typeable typeOf neil [Char] Another great thing is that this bit also works in Hugs, while the

Re: [Haskell-cafe] Data.Generics: how do I get the type name of a value?

2007-12-14 Thread Neil Mitchell
Hi Alistair, http://haskell.org/hoogle/?q=typeOf C:\ghci GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude :m Data.Typeable Prelude Data.Typeable typeOf neil [Char] Thanks Neil On 12/14/07, Alistair Bayley [EMAIL PROTECTED]

Re: [Haskell-cafe] Hoogle error

2007-12-13 Thread Neil Mitchell
Hi Hoogling (-) (=) gives Error, your search was invalid: Parse Error: Unexpected character '=)' Is there a way to escape the input so it would work? (I wasn't really expecting the right results BTW as I think hoogle searches type signatures not patterns in definitions, right?) What were

Re: [Haskell-cafe] Software Tools in Haskell

2007-12-12 Thread Neil Mitchell
Hi main = do (print . showln . length) = getContents where showln a = show a ++ \n This can be written better. print puts a newline at the end and does a show, so lets remove that bit: main = do (print . length) = getContents Now we aren't using do notation, despite having a do block, and

Re: [Haskell-cafe] Software Tools in Haskell

2007-12-12 Thread Neil Mitchell
Hi Having got to the word counting example on the website: wordcount :: IO () wordcount = do wc - wordcount' False 0 putStrLn (show wc) where wordcount' inword wc = do ch - getc case ch of

Re: [Haskell-cafe] GUI

2007-12-12 Thread Neil Mitchell
Hi Is there any really cross-platform GUI library for Haskell? Gtk2Hs is good (I suppose), but it requires X. OK, I have X, but it's not native on my Mac; some Mac users don't install it and almost all Mac users don't always run it. On Windows, Gtk2hs is not as native as wxHaskell, but is

Re: [Haskell-cafe] Literate HTML

2007-12-11 Thread Neil Mitchell
Hi All, Thanks for the general help on literate HTML. It seems that using bird-tick style literate works better than \begin{code} style. I tried it with my document, but quickly gave up - mainly because I decided literateness did not fit with what I was doing. You can compile a .html file with:

Re: [Haskell-cafe] Re: regex package for yhc?

2007-12-11 Thread Neil Mitchell
Hi I cannot quickly find on http://www.haskell.org/haskellwiki/Yhc what YHC supports. From the (just modified) FAQ: http://www.haskell.org/haskellwiki/Yhc/FAQ#Language_Support Q) What extensions does it support? A) Very few. Existentials and pattern guards are supported. Rank-2 types,

[Haskell-cafe] Literate HTML

2007-12-07 Thread Neil Mitchell
Hi I want literate Haskell, but where the literate bit forming a document is actually HTML, not latex. Does anyone have any idea how to go about this? For a start, how do I persuade GHC to run the file: C:\Documents\Uni\tagsouprunhaskell index.html Warning: ignoring unrecognised input

Re: C Preprocessor

2007-12-06 Thread Neil Mitchell
Hi Yes, or just don't use string gaps. ++ works just as well, and GHC will optimise it away when applied to constant strings. There are also other issues, such as ' in variable names (can cause bits to be skipped in that line), /* as an operator, unboxed varids in #define's Thanks Neil

Re: C Preprocessor

2007-12-06 Thread Neil Mitchell
Hi Simon, Yes, sure. (although the ' thing doesn't bite us - perhaps it doesn't apply with -traditional?) I think it bit me last week. I had something like: #define a b foo'bar a In this case it did because a wasn't changed to b. It may have been other complex things going on as well, but

[Haskell-cafe] Hoogle works once more

2007-12-06 Thread Neil Mitchell
Hi, I've just finished updating Hoogle (http://haskell.org/hoogle/) to work with the latest GHC API, in particular all the base split that has occurred and the few functions that were added. It took rather longer than I would have liked, because of paper deadlines etc, but its now sufficiently

Re: [Haskell-cafe] Hoogle works once more

2007-12-06 Thread Neil Mitchell
Hi Is there a way to search on module names? If I put in Data.Map then the one thing that doesn't come up is a link to the library page for Data.Map. That would be a really good short-cut. As Tillman says, you can search for Map alone to find Data.Map. The new version (Hoogle 4) already

Re: [Haskell-cafe] Hoogle works once more

2007-12-06 Thread Neil Mitchell
Hi Dennis, Not sure if this qualifies in any category above, but I just searched for: Monad m = m (m a) - m a And I couldn't find Control.Monad.join on any of the first 4 pages or so of results. If I search for join, of course, the first result is: Control.Monad. join::

[Haskell-cafe] Re: Nofib modifications

2007-12-04 Thread Neil Mitchell
Hi I'd do something like #if defined(__nhc98__) || defined(YHC) #define NO_MONOMORPHISM_RESTRICTION #endif #ifdef NO_MONOMORPHISM_RESTRICTION powers :: [[Integer]] #endif just to make it quite clear what's going on. (good comments would do just as well). I'd rather avoid CPP, as

[Haskell-cafe] Re: [Haskell] Nested guards?

2007-12-04 Thread Neil Mitchell
Hi server text | Just xs - parse text = let x | field1 `elem` xs = error ... do one thing ... | field2 `elem` xs = error ... do something else ... in x server _ = error ... invalid request ... This now has the wrong semantics - before if parse text returned Just []

Re: [Haskell-cafe] Why is this strict in its arguments?

2007-12-04 Thread Neil Mitchell
Hi findAllPath :: (a - Bool) - (BTree a) - [[a]] findAllPath pred = g where g (Leaf l) | pred l = [[l]] g (Branch lf r rt) | pred r = map (r:) $ (findAllPath pred lf) ++ (findAllPath pred rt) g _ = [] without even using maybe. However, 2 questions

[Haskell-cafe] Nofib modifications

2007-12-03 Thread Neil Mitchell
Hi, Some of the nofib suite are messed up by Yhc/nhc because of the monomorphism restriction. Take imaginary/bernouilli as an example: powers = [2..] : map (zipWith (*) (head powers)) powers Hugs and GHC both see powers :: [[Integer]] and a CAF. Yhc (and nhc) both see powers :: (Enum a, Num a)

Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-30 Thread Neil Mitchell
Hi Prelude :b Control.Concurrent.MVar module 'Control.Concurrent.MVar' is not interpreted :b now defaults to :breakpoint, you want :browse Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Working out which library to use (was: Haskell and DB)

2007-11-29 Thread Neil Mitchell
Hi We have the start on a solution for how to pick the good ones. We'll consider which binary IO library is most popular, from: The search engine returns the results: * binary, is used by 12 other packages: This only works with libraries that are lower-level, like binary, which other

Re: [Haskell-cafe] Re: Working out which library to use

2007-11-29 Thread Neil Mitchell
Hi 1. For certain tasks, there are multiple possible packages, and it's not really clear which one to go for. Having more than one choice is good. (E.g., there's Gtk2hs and there's wxHaskell, and you pick the one you want based on personal preference.) Having *dozens* of different packages

Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-29 Thread Neil Mitchell
Hi Does anyone know if/where I can find a specification for the .hi files generated by GHC? I ask because I want to write an omni-completion plugin for Vim to make Haskell hacking a bit nicer. you might find it easier to use GHCi's :browse command Or you might want to try haddock with

Show instance of Ratio

2007-11-28 Thread Neil Mitchell
sense to come to some consensus which Haskell' will follow, then fix whichever set of compilers is determined to be wrong. Opinions -- The basic differing of opinions is should Show print the minimal ASCII representation (Neil Mitchell, Simon Marlow) or something that is slightly pretty

Re: [Haskell-cafe] return in Monad class necessary?

2007-11-26 Thread Neil Mitchell
Hi Henning, I wonder whether it is a typical mistake of beginners to write 'return' within a do-block (that is, not at the end) and if it is possible to avoid this mistake by clever typing. There are legitimate uses of return inside a do, see:

Re: [Haskell-cafe] Re: nhc vs ghc

2007-11-24 Thread Neil Mitchell
Hi can anyone provide a concise list of the major differences between nhc98 and ghc? for example, can i build a cabal package with nhc98? i get that ghc and nhc98 are not interchangeable, otherwise i am not sure The other major differences: * nhc is unavailable on Windows * nhc programs

Re: [Haskell-cafe] Re: nhc vs ghc

2007-11-24 Thread Neil Mitchell
Hi 1. It IS available on Windows. Not without Mingw/Cygwin - which in my mind makes it not Windows native. I also know that the release is made without testing on Windows, and that certain related tools like hmake rely on shell scripts. If there is someone using nhc seriously on Windows, it

Re: [Haskell-cafe] is there a more concise way to generate helper functions for a datatype built on records?

2007-11-24 Thread Neil Mitchell
Hi Some of these can be automatically derived by the Data.Derive tool. If you want any more, then submit a patch and they can all be derived. http://www-users.cs.york.ac.uk/~ndm/derive/ The derivations Set, Is, From, Has, LazySet all look useful. A bit more documentation on what each one does

Re: [Haskell-cafe] Haskell code in Wordpress

2007-11-23 Thread Neil Mitchell
Hi I'm curious about the best way to typeset haskell code in a wordpress blog. Using blockquote removes all indentation. :-( pre should work Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] More accessible papers

2007-11-21 Thread Neil Mitchell
Hi Peter, Yes, but why don't researchers just publish their TEX file? You can regard that as the source code for generating PDF/PS whatever no? Building a .tex file can be rather hard with packages and what-not, plus quite a few of us use lhst2tex as a preprocessor. It's not impossible, but

Re: suggestion: add a .ehs file type

2007-11-20 Thread Neil Mitchell
Hi Alex, .ehs stands for extended haskell and encapsulates the 90% case of people just wanting -fglasgow-exts with a minimum of fuss. That goes against the general GHC direction of trying to wean people off -fglasgow-exts and on to more specific language pragmas. Thanks Neil

Re: [Haskell-cafe] More accessible papers

2007-11-19 Thread Neil Mitchell
Hi Peter, Although this is standard, it is not really accessible for people with people with bad vision, who prefer larger fonts. When you print this, the fonts are rather small. For those people, a reflowable PDF would make much more sense, so they can choose how big the fonts are on screen

Re: [Haskell-cafe] expanded standard lib

2007-11-19 Thread Neil Mitchell
Hi - The packages seem to be of quite variable quality. Some are excellent, some are rather poor (or just not maintained any more). The problem is that only one person gets to comment on the quality of a library, the author, who is about the least objective person. - Almost all packages seem

Re: Re[2]: [Haskell-cafe] the interact function and Hugs/ghci on Windows ...

2007-11-16 Thread Neil Mitchell
Hi Bulat, The released version of WinHugs does not support Ctrl+Z or Ctrl+D, but the development builds do. btw, are you plan to release hugs version compatible with ghc 6.8? That would make sense, and I suspect Ross will want to (he's in charge of Hugs stuff). I am super-busy until after

Re: [Haskell-cafe] the interact function and Hugs/ghci on Windows ...

2007-11-16 Thread Neil Mitchell
Hi The released version of WinHugs does not support Ctrl+Z or Ctrl+D, but the development builds do. If you download: http://haskell.org/hoogle/other/winhugs-interact-fixes-2006-oct-25.zip and replace the WinHugs.exe with this new one then you should get that functionality. Thanks Neil On

[Haskell-cafe] Showing Data.Ratio - different on GHC vs Hugs/Yhc

2007-11-16 Thread Neil Mitchell
Hi Under Hugs and Yhc, showing a Ratio 1%2 gives 1 % 2. Under GHC showing 1%2 gives 1%2. Does the standard say anything about this? Is someone wrong? And how do Yhc/nhc/Hugs pass Bernouilli in the Nofib suite given that the output doesn't match? Thanks Neil

Re: State of parallel GC?

2007-11-15 Thread Neil Mitchell
Hi I am curious, because I have a project in mind that would benefit greatly from real-time, parallel garbage collection :) Is Haskell real-time? Doesn't lazy evaluation rather destroy lots of the real-time properties that you might like in a language. If you want a real-time functional

Re: [Haskell-cafe] let vs. where

2007-11-14 Thread Neil Mitchell
Hi Chris, this could be captured nicely in a where clause: exp = (fst blah, snd blah) where blah = gg 1000 But a let would have to be placed in both elements of the tuple exp = (let blah = g 1000 in fst blah, let blah = g 1000 in snd blah) Why not: exp = let blah = g 1000 in

Top-level bindings for unlifted types

2007-11-13 Thread Neil Mitchell
Hi, The following program: --- {-# OPTIONS_GHC -fglasgow-exts #-} module Test() where import GHC.Base test = realWorld# - gives the error message: Top-level bindings for unlifted types aren't allowed: {

Re: Top-level bindings for unlifted types

2007-11-13 Thread Neil Mitchell
Hi Top-level unboxed values would then behave just like #define constants, in fact. This is certainly possible, it would just add complexity to the compiler in various places. Yes, that was all I was thinking of. I'm not suggesting that these things actually get implemented, but it did seem

Re: [Haskell-cafe] Haskell library documentation question

2007-11-13 Thread Neil Mitchell
Hi Is there anyway to get a .pdf version of http://www.haskell.org/ghc/docs/latest/html/libraries/? Yes, you could print it to PDF using something like acrobat distiller. Otherwise you could modify haddock to generate Latex markup and compile that. My question is why you would want

Re: [Haskell-cafe] let vs. where

2007-11-13 Thread Neil Mitchell
Hi This depends on whether you are an expression style or declaration style programmer. http://www.haskell.org/haskellwiki/Declaration_vs._expression_style http://www.haskell.org/haskellwiki/Let_vs._Where Reading the let vs where page I'm left with the strong impression that I should use

Re: [Haskell-cafe] let vs. where

2007-11-13 Thread Neil Mitchell
Hi Maybe it would be enough to represent the example where problem more fairly on its own terms. The non-working example has us writing f = State $ \ x - y where y = ... x ... I just don't think this example is representative of the typical decisions in the trade-off. There are

[Haskell-cafe] Re: [Haskell] GHC6.8.1 can not compile the simple example

2007-11-12 Thread Neil Mitchell
Hi David, In future, please post emails to haskell-cafe@, the haskell@ list is for annoucements. The correct command line is: ghc --make c.hs Thanks Neil On Nov 12, 2007 1:11 PM, david yu [EMAIL PROTECTED] wrote: Link error is: [EMAIL PROTECTED] test]$ ghc c.hs c.o: In function

Re: [Haskell-cafe] Haskell and html input elements

2007-11-12 Thread Neil Mitchell
Hi If you simply want to start a batch Haskell program, and see its output as HTML in a browser, you can use the cgi [1] or fastcgi [2] libraries listed on Hackage. This is the approach that Hoogle takes, and turned out to be very easy. The code is all available, so you can start from that.

Re: [Haskell-cafe] Interesting effect of upgrading GHC

2007-11-12 Thread Neil Mitchell
Hi I just removed GHC 6.6.1 and installed 6.8.1, and I noticed something rather unexpected. I recompiled an existing program (with -O2), and instead of taking 30 seconds to compile, it took roughly 2 seconds. In previous releases, certain constructs took O(n^2) time to compile. One that was a

[Haskell-cafe] Data.Set.member vs Data.List.elem

2007-11-12 Thread Neil Mitchell
Hi, Is there a good reason that Data.Set uses the name member while Data.List (or the Prelude) uses the name elem, for what to me seem identical concepts. I realise that in Set's the traditional test is for membership, but it seems awfully arbitrary that one jumped one way and one jumped the

Re: [Haskell-cafe] Somewhat random history question - chicken and egg

2007-11-11 Thread Neil Mitchell
Hi ...if GHC is written in Haskell, how the heck did they compile GHC in the first place? GHC was not the first Haskell compiler, hbc was the main compiler at some point, so I suspect they used hbc. There was also lazy ML which I suspect was used to bootstrap hbc - but I'm not sure of the

Re: [Haskell-cafe] Somewhat random history question - chicken and egg

2007-11-11 Thread Neil Mitchell
Hi GHC can be compiled with GHC 5.0 (or something around there). If they add a new feature, they don't use it in GHC for years and years. *Can* be compiled with GHC 5.0, or *is* compiled? Can. If a feature goes horribly wrong, or a build is entirely broken in some subtle but fundamental

Re: [Haskell-cafe] Somewhat random history question - chicken and egg

2007-11-11 Thread Neil Mitchell
Hi bear no resemblence to any machine-level constructs, and it seems unthinkable that you could possibly write such a compiler in anything but Haskell itself. Hugs is written in C. Really? :-. Really :-) (Seriously, how big is Hugs? It must be quite large...) 56111 lines, with

Re: [Haskell-cafe] Disable echo in POSIX terminal

2007-11-09 Thread Neil Mitchell
Hi I've written a little Haskell program to get information from a MySQL database (great thanks to anybody reading this who works on HSQL, by the way) but I want to keep the user's password concealed, obviously. Currently I prompt for it from the terminal, but the problem is that it's echoed

Re: [Haskell-cafe] MD5?

2007-11-09 Thread Neil Mitchell
Hi The final alternative is that I just call MD5SUM.EXE from my Haskell program and try to parse the output. But that strikes me as rather messy. Messy, but I don't see any disadvantage to doing it this way - if you can control that the MD5SUM program is installed alongside your code. Of

Re: [Haskell-cafe] MD5?

2007-11-09 Thread Neil Mitchell
Hi The MD5SUM.EXE file I have chokes if you ask it to hash a file in another directory. It will hash from stdin, or from a file in the current directory, but point-blank refuses to hash anything else. Try http://www.cs.york.ac.uk/fp/yhc/dependencies/UnxUtils.zip - that has an MD5SUM program

Re: [Haskell-cafe] please help... small problem

2007-11-09 Thread Neil Mitchell
Hi Is there anyway to cut down this code and to not use auxillary functons, but instead use pattern matching? You haven't attached any code, but even if you had, I don't think it would have worked. [hi ryan 1,hi jeff 2] becomes [[hi,ryan 1], [hi,jeff, 2]]. In Haskell lists are collections

Re: [Haskell-cafe] hoogle broken?

2007-11-07 Thread Neil Mitchell
Hi Mike, It looks as if hoogle isn't working. I get 404s whenever I try to do any search on hoogle. Hoogle works for performing searches, but the documentation links are incorrect. Expect this fixed by this evening! Thanks Neil ___ Haskell-Cafe

Re: [Haskell-cafe] hoogle broken?

2007-11-07 Thread Neil Mitchell
Hi Mike, It looks as if hoogle isn't working. I get 404s whenever I try to do any search on hoogle. I have fixed quite a lot of the links, some will still be broken, but hopefully not too many. Really, hoogle needs upgrading to use the new base library etc - I'll try and do that sometime

Re: [Haskell-cafe] Building Haskell stuff on Windows

2007-11-07 Thread Neil Mitchell
Hi Arthur, The correct steps to take are: 1) install GHC from the windows installer - trivial 2) install Gtk2hs from the windows installer Unfortunately Gtk2hs hasn't been updated to work with GHC 6.8.1, so step 2 will fail. The person who is going to do this is Duncan. He usually breaks down

Re: Re[2]: [Haskell-cafe] Re: torrent for 6.8.1?

2007-11-04 Thread Neil Mitchell
Hi The binaries are ~47MiB apiece. I suspect that almost everyone on Windows and Linux x86 will want the binaries too, since compiling GHC tends to take a while. Anyway, it seems like haskell.org is becoming more responsive now, but it would be something to keep in mind for the future.

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Neil Mitchell
Hi I've been working on optimising Haskell for a little while (http://www-users.cs.york.ac.uk/~ndm/supero/), so here are my thoughts on this. The Clean and Haskell languages both reduce to pretty much the same Core language, with pretty much the same type system, once you get down to it - so I

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Neil Mitchell
Hi So in a few years time when GHC has matured we can expect performance to be on par with current Clean? So Clean is a good approximation to peak performance? No. The performance of many real world programs could be twice as fast at least, I'm relatively sure. Clean is a good short term

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-10-31 Thread Neil Mitchell
Hi I don't think the register allocater is being rewritten so much as it is being written: From talking to Ben, who rewrote the register allocator over the summer, he said that the new graph based register allocator is pretty good. The thing that is holding it back is the CPS conversion bit,

Re: [Haskell-cafe] Binary constants in Haskell

2007-10-24 Thread Neil Mitchell
Hi Are there binary constants in Haskell, as we have, for instance, 0o232 for octal and 0xD29A for hexadecimal? No, though it is an interesting idea. You can get pretty close with existing Haskell though: (bin 100010011) where bin :: Integer - Integer, and is left as an exercise for

Re: [Haskell-cafe] wordsBy in the base libraries?

2007-10-22 Thread Neil Mitchell
Hi We certainly need a function to split a list into sections. Whether it be wordsBy, or something like linesBy, or some new split variant. wordsBy :: (a - Bool) - [a] - [[a]] wordsBy p s = case dropWhile p s of [] - [] s':rest - (s':w) : wordsBy p s'' where (w, s'')

Re: [Haskell-cafe] XML parser recommendation?

2007-10-22 Thread Neil Mitchell
Hi Ketil, I'm struggling to get my HXT-based parser to parse a largish file (300MB), even after breaking into reasonably-sized chunks. The culprit appears to be parsing one element comprising 25K lines of text, which apparently requires more memory than the 2Gb my computer is equipped with.

Re: [Haskell-cafe] wordsBy in the base libraries?

2007-10-22 Thread Neil Mitchell
Hi You are still over by one test. Try instead: wordsBy :: (a - Bool) - [a] - [[a]] wordsBy p s = case dropWhile p s of [] - [] s':rest - (s':w) : wordsBy p (drop 1 s'') where (w, s'') = break p rest This still has the redundant empty list tests, Perhaps.

Re: [Haskell-cafe] wordsBy in the base libraries?

2007-10-22 Thread Neil Mitchell
Hi If you want to guarantee that level of optimization, you probably have to inline everything by hand and not use any library functions at all. I wonder how much of that is already done by the compiler, though. A reasonable level of optimisation for this function would be that the

Re: [Haskell-cafe] string literals and haskell'

2007-10-22 Thread Neil Mitchell
Hi I can see problems with this. This comes up when typing windows file path's: C:\path to my\directory\boo If this now reports no errors, who wants to guess which come up as escape codes, and which don't. The way other languages like C# have dealt with this is by introducing a new type of

Re: [Haskell-cafe] OS Abstraction module??

2007-10-22 Thread Neil Mitchell
Hi Bill, In the Haskell libraries, is there an OS abstraction module, that would hide the POSIX API and Win-32 API? If not, this would be nice so that Haskell programs could be written in an OS independent manner! Yes, Haskell provides a fairly complete API in the base libraries, which

Re: [Haskell-cafe] OS Abstraction module??

2007-10-22 Thread Neil Mitchell
module to manipulate filepaths, if you are doing that to any great extent. If you say what you are tying to do, and why you suspect it might not just work in a cross platform manner, people might be able to address your specific concerns. Thanks Neil On 10/22/07, Neil Mitchell [EMAIL PROTECTED

Re: [Haskell-cafe] OS Abstraction module??

2007-10-22 Thread Neil Mitchell
Hi Bill I am really talking about a module or perhaps a Haskell class that provides notion for multiple threads of execution, semaphores, .. that hides POSIX vs Win32 APIs .. i.e. the underlying OS APIs would be totally hidden. I think you are thinking in a C way. In Haskell, portable is

Re: [Haskell-cafe] OS Abstraction module??

2007-10-22 Thread Neil Mitchell
Hi Bill, I am really talking about a module or perhaps a Haskell class that provides notion for multiple threads of execution, semaphores, .. that hides POSIX vs Win32 APIs .. i.e. the underlying OS APIs would be totally hidden. I think you are thinking in a C way. In

Re: Command Line Arguments

2007-10-18 Thread Neil Mitchell
Hi As an Haskell beginner, and considering this may be compiler dependent, I shall ask it on this list. It's standard across all implementations. How can I access command line arguments from my main function in my Main module? import System.Environment main = do args - getArgs

Re: Command Line Arguments

2007-10-18 Thread Neil Mitchell
Hi So that's part of the Haskell98 standard? In the Haskell98 standard it can be imported from System, rather than System.Environment. Nowadays all compilers can use either. Nice! So, is it usual for compilers to implement extensions to the standard? If yes, where can I find the

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-17 Thread Neil Mitchell
Hi In general, if it compiles and type checks, it will work. It is rare that an interface stays sufficiently similar that the thing compiles, but then crashes at runtime. Given that, shouldn't the tested versions be something a machine figures out - rather than something each library

Re: [Haskell-cafe] Strange subtract operator behavior

2007-10-16 Thread Neil Mitchell
Hi (/ 10) means the function that divides its argument by 10 (- 10) however is just the number -10, even if I put a space between the - and 10. How can I create a function that subtracts 10 from its argument in a clean way then? subtract is the way to go. (`subtract` 10) I think you

Re: [Haskell-cafe] Strange subtract operator behavior

2007-10-16 Thread Neil Mitchell
Hi I think you should have to write negative numbers using the syntax 0-10, since currently having one single unary operator is ugly. I think writing 0-10 is ugly. Ugly - yes. But very clear as to its meaning. How often do people actually write negative numeric literals? My guess is that

<    1   2   3   4   5   6   7   8   9   10   >