Re: [Haskell-cafe] Operational Semantics of Haskell

2007-07-31 Thread Neil Mitchell
Hi Is there a good source for the operational semantics of Haskell? I am trying to squeeze the most efficiency out of a bit of code and am looking to remove unnecessary reductions. You probably aren't after operational semantics - the compiler takes your code and optimises it to something

Re: [Haskell-cafe] Avoiding boilerplate retrieving GetOpt cmd line args

2007-07-27 Thread Neil Mitchell
Hi Why not: data Flag = Filter String | DateFormat String | DocStart String | DocEnd String Becomes: data Flag = Flag Key String data Key = Filter | DateFormat | DocStart | DocEnd getString :: Flag - Key - String getString (Flag x y) key = if key == x then y else You can easily

Re: Re : [Haskell-cafe] Indentation woes

2007-07-26 Thread Neil Mitchell
Hi Why do you think it should be allowed? The current rules are arbitrary, but they are quite simple; we don't want to add an ad-hoc exception just for this. The current rules are already quite complex, I believe there is some thought being given as to how to simplify them. Out of

Re: [Haskell-cafe] Optimizing Haskell compilers

2007-07-26 Thread Neil Mitchell
Hi I've heard that there are a plethora of Haskell compilers available. Which others give performance comparable to GHC? None. If you want a stable, well supported, currently maintained, fast Haskell compiler, then that's GHC. (in fact, if you drop fast from that list, you are still left with

Re: [Haskell-cafe] [meta] the haskell wiki management

2007-07-25 Thread Neil Mitchell
Hi Andrea, I though that using the Haskell wiki was appropriate, so I started writing down what I learned thanks to those guys. It is certainly a good place to put it! Then suddenly, Sunday night, I could not find my page anymore. On renaming a page, doesn't a redirect get placed from the

Re: Re[4]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Neil Mitchell
Hi There's really no such thing as Windows native controls any more, at least not ones that any apps actually use. You'll note that Internet Explorer, MS Office and VisualStudio all paint their own custom control set that are similar but not exactly the same as the native controls (eg those

Re: Re[6]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Neil Mitchell
Hi Bulat, can you please give screenshots? in particular, i see unix-like style in TreeCtrl and scrollbars in examples i've built from gtk2hs. The scroll bars are OK: http://www-users.cs.york.ac.uk/~ndm/temp/proof.png The appearance is native, but the arrow on the left shouldn't be disabled

Re: Re[2]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-23 Thread Neil Mitchell
Hi - native appearance I think that's pretty good these days, the native theme on Windows has been getting better and better from Gtk+ 2.6 to the current 2.10 wxHaskell used to be 10 times better than Gtk, now its about twice as good. The Gtk developers are seriously addressing some of the

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-23 Thread Neil Mitchell
Hi But for the current version of my code, there is still a bit of a performance gap between our two methods. Here are the stats I get (ghc -O3, 2.4GHz x86): Are you aware that -O3 is slower than -O2 and -O in ghc? If you want fast code then specify -O2, not -O3. Thanks Neil

[Haskell-cafe] Equational Reasoning goes wrong

2007-07-22 Thread Neil Mitchell
Hi Haskell is known for its power at equational reasoning - being able to treat a program like a set of theorems. For example: break g = span (not . g) Which means we can replace: f = span (not . g) with: f = break g by doing the opposite of inlining, and we still have a valid program.

Re: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-21 Thread Neil Mitchell
Hi Bulat, can anyone provide wxHaskell already compiled/compilable with ghc 6.6.1 on Windows? This is precisely the reason I switched to Gtk2Hs - Duncan provides Windows installers as each new GHC release comes out. If wxHaskell wants to stand any chance as an alternative GUI framework there

Re: [Haskell-cafe] A really bad way to say all isSpace

2007-07-17 Thread Neil Mitchell
Hi Reading through the code to lex, it appear that it will return [(,)] if and only if all isSpace t. If this is really the case, does it make sense to state all isSpace t? It has a much clearer meaning to me. I think 'lex' is supposed to not understand (haskell-style) comments - which I

[Haskell] AngloHaskell 2007, dates and venue confirmed

2007-07-13 Thread Neil Mitchell
Hi, We are pleased to announce AngloHaskell 2007 http://www.haskell.org/haskellwiki/AngloHaskell Dates: 10th-11th of August (Friday-Saturday) Location: Cambridge, with talks at Microsoft Research on Friday All the details are on the wiki page, along with free registration. Everyone is

[Haskell-cafe] AngloHaskell 2007, dates and venue confirmed

2007-07-13 Thread Neil Mitchell
Hi, We are pleased to announce AngloHaskell 2007 http://www.haskell.org/haskellwiki/AngloHaskell Dates: 10th-11th of August (Friday-Saturday) Location: Cambridge, with talks at Microsoft Research on Friday All the details are on the wiki page, along with free registration. Everyone is

Re: [Haskell-cafe] Maintaining the community

2007-07-13 Thread Neil Mitchell
Hi I tried an experiment this week of just taking someone's post (Conor's idiom brackets), and putting directly on the wiki first, then letting the author know that's happened. How do people feel about allowing posts in -cafe to be placed on the wiki, without extensive prior negotiation? What

Re: [Haskell-cafe] Maintaining the community

2007-07-13 Thread Neil Mitchell
Hi * At any point, create [EMAIL PROTECTED] This would have the advantage that people might not be so intimidated at making their first post here, and posts wouldn't be answered with category theory or scary type extensions. The disadvantages are that it makes an artificial barrier

Re: [Haskell-cafe] Indentation Creep

2007-07-13 Thread Neil Mitchell
Hi In particular, I wrote a Trie implementation. Neat, I often feel I should be using one of those, but never do because Data.Map is just too temptingly close by. A couple of the combinators can be used to simplify some bits: case v of Nothing - return True

Re: Make it possible to evaluate monadic actions when assigning record fields

2007-07-12 Thread Neil Mitchell
Hi Put differently, I don't see a compelling use-case for the proposed syntax extension. But I've seen many misused monads. A compelling use-case: http://darcs.haskell.org/yhc/src/libraries/core/Yhc/Core/Simplify.hs Look at coreSimplifyExprUniqueExt And from that file: -- helpers,

Re: Re[2]: Make it possible to evaluate monadic actions when assigning record fields

2007-07-12 Thread Neil Mitchell
Hi This extension seems like a great idea - my only concern would be about the order of computations. Clearly left-to-right makes sense, but this may break some natural intuition in Haskell: i think that undefined order will be a best one Using undefined does not make for great reading in

Re: [Haskell-cafe] function unique

2007-07-11 Thread Neil Mitchell
Hi unique = unique' [] unique' _ [] = [] unique' history (x:xs) = if x `elem` history then next else (x:next) where next = (uniq' (x:hist) xs) You can express this more neatly: unique' _ [] = [] unique' history (x:xs) = [x | x `notElem` history] ++ unique' (x:history) xs Thanks Neil

Re: [Haskell-cafe] ANNOUNCE: HCL v1.0 -High-level library for building command line interfaces

2007-07-10 Thread Neil Mitchell
Hi When building on Linux something gets confused because of filenames in Windows style. Namely, hangman becomes hangman^M Your Cabal file should be in Unix format, i.e. without \r\n's in it, just \n's. Arguably this is either a Cabal bug, or something that Cabal-upload should be checking.

[Haskell-cafe] A really bad way to say all isSpace

2007-07-10 Thread Neil Mitchell
Hi, Reading through the code to read: read s = case [x | (x,t) - reads s, (,) - lex t] of [x] - x [] - error Prelude.read: no parse _ - error Prelude.read: ambiguous parse Reading through the code to lex, it appear that it will return [(,)] if and

Re: [Haskell-cafe] ANNOUNCE: HCL v1.0 -High-level library for building command line interfaces

2007-07-10 Thread Neil Mitchell
Hi Your Cabal file should be in Unix format, i.e. without \r\n's in it, just \n's. I'm surprised that our resident Windows hacker would advocate this, instead of a more tolerant approach to line ending conventions :-) Line endings should be one character long, they always should have been.

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Neil Mitchell
Hi The worst problem that comes of this is a slow loss of disk space, but I don't think I'll ever be able to fill this 80G disk :) ...OK...and when you tell GHC to compile something, exactly which compiler does it run? o_O It picks whichever one you have first on your $(PATH). On linux

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Neil Mitchell
Hi It picks whichever one you have first on your $(PATH). ...right. Presumably this is isomorphic to whichever one was installed the most recently? (Oh, wait... IIRC, on Windoze the GHC installer doesn't actually add GHC to the PATH variable. You have to do it by hand...) It does. Thanks

Re: [GHC] #1518: Make it possible to evaluate monadic actions when assigning record fields (-)

2007-07-09 Thread Neil Mitchell
Hi Adde, #1518: Make it possible to evaluate monadic actions when assigning record fields It is currently not possible to build records from values resulting from monadic actions while still using the field-specifiers. This is quite a significant change to the language, which isn't precise

Unexpected boxing in generated code

2007-07-09 Thread Neil Mitchell
Hi, I've got an inner loop that I think I can see is strict in the Int argument being passed around, but that GHC 6.6.1 isn't unboxing. In the following example both functions take a GHC.Base.Int, which I think should be an Int#. Rec { f60_rS5 :: GHC.Prim.State# GHC.Prim.RealWorld -

Re: [Haskell-cafe] Too many packages on hackage? :-)

2007-07-08 Thread Neil Mitchell
Hi Looks like there's too many packages on hackage.haskell.org now for a single page listing: http://hackage.haskell.org/packages/archive/pkg-list.html Perhaps we can have a page with just the categories, with subpages hanging off? Please don't. With one large page I can search the

Re: [Haskell-cafe] Fun with ByteStrings [was: A very edgy language]

2007-07-08 Thread Neil Mitchell
Hi I guess the question that's really burning in my mind is if ByteString is so much faster than [x], why can't you just do the same optimisations to [x]? In other words, why should I need to alter my code to get all this fusion goodness? You already get some benefit of fusion with lists: *

Re: [Haskell-cafe] In-place modification

2007-07-08 Thread Neil Mitchell
Hi btw, you doesn't need to use unix in order to play with ghc HEAD - you can download compiled windows binary Seriously? I'm pretty sure I tried to do that and couldn't... Seriously. Thanks to Igloo, you can even download a GHC nightly complete with an installer! It doesn't get any easier

Re: [Haskell-cafe] Trying to make a Typeable instance

2007-07-07 Thread Neil Mitchell
Hi Adrian You can use Data.Derive to do this for you: http://www-users.cs.york.ac.uk/~ndm/derive/ Or DrIFT: http://repetae.net/~john/computer/haskell/DrIFT/ Thanks Neil On 7/7/07, Adrian Hey [EMAIL PROTECTED] wrote: Adrian Hey wrote: Hello, I'm trying to make the type (ListGT map k a) an

Re: [Haskell-cafe] Trying to make a Typeable instance

2007-07-07 Thread Neil Mitchell
Hi data ListGT map k a = Empt | BraF ![k] a !(map (ListGT map k a)) | BraE ![k] !(map (ListGT map k a)) deriving( Typeable ) Not in Haskell, only in GHC. Thanks Neil ? On 7/7/07, Adrian Hey [EMAIL PROTECTED] wrote: Hello, I'm trying to make the type (ListGT map k a) an

Re: problem compiling an older Haskell program with GHC 6.6.1

2007-07-06 Thread Neil Mitchell
Hi http://dfa.imn.htwk-leipzig.de/cgi-bin/cvsweb/lib/Autolib/Data/Map.hs?rev=1.6 Or easier: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FiniteMap-0.1 Thanks Neil ___ Glasgow-haskell-users mailing list

Re: Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Neil Mitchell
Hi It's not a great experience now, but hopefully things are moving in the right direction. - Found crypto 3.0.3 on hackage. - Tried to build, it depends on NewBinary Cabal-install is intended to remove this problem, so that you can say i want crypto and it gets everything that requires. -

Re: [Haskell-cafe] Getting debugging/logging info?

2007-07-02 Thread Neil Mitchell
Hi SystemLogging.LogInfo(Did Something); SystemLogging.LogInfo(x is + x ); How can we do something similar in Haskell? See trace: http://www.haskell.org/hoogle/?q=trace Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Language semantics

2007-06-30 Thread Neil Mitchell
Hi What's Uniplate? http://www-users.cs.york.ac.uk/~ndm/uniplate/ may help to answer that question. I haven't even finished understanding SYB, yet, though; I'm still mystified by how to use Data.Generics.Twins.gzipWithQ. So, I'm not at a stage where I can usefully contrast Uniplate with the

[Haskell] Anglo Haskell 2007, call for participation

2007-06-28 Thread Neil Mitchell
Hi, People have proposed that we have another AngloHaskell this year. These events are being coordinated via the wiki: http://www.haskell.org/haskellwiki/AngloHaskell The current thoughts are to have a day of talks on Friday, followed by a day of social activities (punting perhaps, maybe some

Re: [Haskell-cafe] Wikipedia archiving bot - code review

2007-06-25 Thread Neil Mitchell
Hi You may find that the slow down is coming from your use of the TagSoup library - I'm currently reworking the parser to make sure its fully lazy and doesn't space leak. I hope that the version in darcs tomorrow will have all those issues fixed. Thanks Neil On 6/26/07, Gwern Branwen [EMAIL

Re: [Haskell-cafe] Re: Best idiom for avoiding Defaulting warnings with ghc -Wall -Werror ??

2007-06-24 Thread Neil Mitchell
Hi 1) The programmer has to detail in some form the proof that his program terminates. Arguably, he ought to do so anyway but he doesn't need to write his proof in a way that can be checked by a dumb computer. Take for example minimum = head . sort minimum [1..] gives _|_ non-termination

Re: [Haskell-cafe] Constructing a datatype given just its constructor as a string?

2007-06-24 Thread Neil Mitchell
Hi mkConstr :: String - Constr parseData :: (Data a) = String - a fromConstr, plus a bit of work to create the constructor. http://www.haskell.org/hoogle/?q=fromConstr Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: 64-bit windows version?

2007-06-23 Thread Neil Mitchell
Hi Don't forget .. Mingw has to be installed too .. and in fact that is much harder. I tried to install MSYS and gave up. You're kidding right? There's Windows installer .exes for MinGW and MSYS. You download it, run it, and click Next a few times. Its far from that easy! Its loads of

Re: [Haskell-cafe] Odd lack of laziness

2007-06-23 Thread Neil Mitchell
Hi I have most of a Data.Nat library done, I should finish it off and release it... Thanks Neil On 6/22/07, Stefan O'Rear [EMAIL PROTECTED] wrote: On Fri, Jun 22, 2007 at 07:14:39PM +0100, Andrew Coppin wrote: Chaddaï Fouché wrote: You should be using BS.null f rather than BS.length f 0.

Re: [Haskell-cafe] Parallel + exceptions

2007-06-23 Thread Neil Mitchell
Hi Parallel: I think this is pretty well solved with STM. I think STM is production ready in GHC. Exceptions: These are less well solved, people are still thinking about some of the issues. In general, you probably don't want to use exceptions too much - the Maybe Monad is often a better

Re: [Haskell-cafe] A Query Language for Haskell Terms

2007-06-23 Thread Neil Mitchell
Hi Regarding the first point, I am aware of with the following options: - SYB (Data.Generics..) You may also want to take a look at Uniplate: http://www-users.cs.york.ac.uk/~ndm/uniplate/ That (or SYB) should take care of your query/transform issues, and the ACL stuff can be layered on top

Re: [Haskell-cafe] Best idiom for avoiding Defaulting warnings with ghc -Wall -Werror ??

2007-06-23 Thread Neil Mitchell
Hi All the puffing about the advantages of strong typing look pretty silly if code hangs up on an incomplete pattern. Okay... people who don't worry so much about incomplete patterns believe that they get things done. There are trade offs in type systems about how much effort you want to

Re: [Haskell-cafe] A probably-stupid question about a Prelude implementation.

2007-06-22 Thread Neil Mitchell
Hi Michael, You're wrong :) foldr (||) False (repeat True) Gives: True Remember that in Haskell everything is lazy, which means that the || short-circuits as soon as it can. Thanks Neil On 6/22/07, Michael T. Richter [EMAIL PROTECTED] wrote: So, I'm now going over the code in the

Re: 64-bit windows version?

2007-06-20 Thread Neil Mitchell
Hi I'm not sure I understand this. MS tools are free to download by anyone, but not redistributable. The binaries needed by programs *built* by those tools are not only free to download, they're free to redistribute, and they're less encumbered than almost all so-called 'free software'

Re: [Haskell-cafe] latex table and backgound color

2007-06-19 Thread Neil Mitchell
Hi Adrian, You are probably better asking on a latex mailing list - this one is mainly for questions about the Haskell programming language. If you are on IRC the #latex channel on irc.freenode.net is very good - that's where I go with my latex questions! Thanks Neil On 6/19/07, Adrian Dusa

Re: [Haskell-cafe] Avoiding Non-exhaustive patterns in function f

2007-06-19 Thread Neil Mitchell
Hi I understand this has nothing to do with type checking, but why can't the compiler give a warning about this? Or is this by design or because it is impossible to check with more complex recursive data types? Take a look at Catch from Neil Mitchell: http://www-users.cs.york.ac.uk/~ndm

[Haskell-cafe] Re: [Haskell] ANN: Uniplate 1.0

2007-06-18 Thread Neil Mitchell
Hi The draft paper feels more readable and up-to-date than the manual. That's very true! Originally there was a manual, now there is a paper - perhaps I should take the manual down if people think that the paper is sufficiently readable? However I have one comment about it. In the section

[Haskell-cafe] Re: [Haskell] ANN: Uniplate 1.0

2007-06-18 Thread Neil Mitchell
Hi Thinking about this slightly further... For the implementation, Data.Derive has a special case for lists, tuples and Maybe. Its a shame that only a restricted number of types are supported - things like Data.Map/Data.Set can be supported perfectly, apart from restrictions in Template

Re: [Haskell-cafe] Useful IDE features - What abaut automatically adding import statements?

2007-06-17 Thread Neil Mitchell
Hi It's one of the features I want to add to GuiHaskell (http://www-users.cs.york.ac.uk/~ndm/guihaskell/). Once the main code base is finished, things like this should be relatively easy. Thanks Neil On 6/17/07, Marc Weber [EMAIL PROTECTED] wrote: On Sun, Jun 17, 2007 at 10:58:04AM +0100,

Re: [Haskell-cafe] IDE?

2007-06-17 Thread Neil Mitchell
Hi And that's why IMHO for Windows users, one needs a friendly IDE to get started with Haskell in a modern way. And the Windows version should comply to the Windows styleguides. I use TextPad and WinHugs, you might find Visual Studio meets your needs better. Both those options are properly

[Haskell] ANN: Uniplate 1.0

2007-06-15 Thread Neil Mitchell
Hi, I am pleased to announce Uniplate (formerly known as Play), a library for boilerplate removal requiring only Haskell 98 (for normal use) and optionally multi-parameter type classes (for more advanced features). This library has been tested with Yhc, Hugs and GHC. The Uniplate library can do

[Haskell] ANN: Catch (first ever release)

2007-06-08 Thread Neil Mitchell
Hi, Do you sometimes encounter the dreaded pattern match failure: head [] message? Do you have incomplete patterns which sometimes fail? Do you have incomplete patterns which you know don't fail, but still get compiler warnings about them? Would you like to statically ensure the absence of all

[Haskell-cafe] Re: [Haskell] ANN: Catch (first ever release)

2007-06-08 Thread Neil Mitchell
Following up on haskell-cafe: Hi Chris, For the last few years I've been working on a pattern-match checker for Haskell, named Catch. I'm now happy to make a release: I would love to use this with regex-tdfa (and the other regex-* modules). At the moment regex-tdfa is uses a few extensions

Re: [Haskell-cafe] Good article on why implementing a functional back end is really different

2007-06-07 Thread Neil Mitchell
Hi Help. I need support for a technical argument: why going to an intermediate form for an existing functional back end like Haskell really, truly is better for implementing a functional language than is going to an intermediate form like the Java intermediate form and re-doing all the various

Re: [Haskell-cafe] GTK2HS

2007-06-07 Thread Neil Mitchell
Hi Andrew, I just tried to install Gtk2hs and got an error message to the effect that it cannot be installed since I have GHC 6.6.1, which isn't 6.6 or 6.4. Anybody know how to fix this? Am I being dumb? Are you running Windows or Linux? If Linux, where did you get your package from? After

[Haskell-cafe] Re: Parsec problem

2007-06-06 Thread Neil Mitchell
Hi I suppose names or try names succeeds without consuming input, but calling parsecQuery fails for another reason that you haven't shown, I assume (from the docs) that try names doesn't consume input (the try is meant to take care of that). I also know that spaces ; types works on its own,

Re: [Haskell-cafe] Re: Parsec problem

2007-06-06 Thread Neil Mitchell
Hi Tillmann http://www.cs.york.ac.uk/fp/darcs/hoogle/src/Hoogle/Query/Parser.hs My guess: names can never fail, so types is never tried, and eof fails. You are correct. Thanks very much! Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: standard function

2007-06-06 Thread Neil Mitchell
Hi @Neil: Is there a way to let hoogle find this kind of stuff? It would be a quite complex inference though. Finding map ($ x) - no. As soon as you allow combination of functions in various combinations, the search space explodes. For every function you now have id map, id . map f etc - way

[Haskell-cafe] Use of Data.Generics.everywhere'

2007-06-06 Thread Neil Mitchell
Hi, I'm looking into SYB, and I'm trying to find examples where people have used everywhere' (note: not everywhere, but with a \prime) - unfortunately I can't find any. I've tried Google Code Search, and it comes up with one rather trivial example which could equally have been everywhere. The

Re: Prelude not in haskell98?

2007-06-05 Thread Neil Mitchell
Hi Iavor, All this seems to indicate that the Prelude is not a part of the haskell98 package. Is this the case, and if so, is this intentional? It would be nice if we could create Cabal packages that explicitly indicate that the library depends only on Haskell 98 libraries. Its true, and

[Haskell-cafe] Parsec problem

2007-06-05 Thread Neil Mitchell
Hi, I'm using parsec to parse something which is either a name or a type. The particular test string I'm using is a type, but isn't a name. I want things to default to name before type. Some examples of the parsec function, and the result when applied to a test string: parsecQuery = do spaces

Re: [Haskell-cafe] Template Haskell, information about data constructor types

2007-06-04 Thread Neil Mitchell
Hi Simon, On 6/4/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote: | Where typeApp splits a type to find its constructor, ctorTypes gets | the types of the fields, and dataCtors gets the constructors in a data | type. Unfortunately reify doesn't seem to work on types. Is it | possible to do what

Re: [Haskell-cafe] RE: [Haskell] boilerplate boilerplate

2007-06-04 Thread Neil Mitchell
Hi On 6/1/07, Alex Jacobson [EMAIL PROTECTED] wrote: I suppose a deriveAll command from template haskell would work. Is that really possible? Asking people who have more knowledge of template haskell, I'm still not sure. What it would really rely on is: getDataDeclarationsInCurrentModule

Re: [Haskell-cafe] How to read -ddump-hi output (and other phases) from GHC

2007-06-04 Thread Neil Mitchell
Hi 4.16.3. How to read Core syntax http://www.haskell.org/ghc/docs/latest/html/users_guide/options-debugging.html#id3130643 I found that -ddump-simpl gives you good information, in a readable form - I much prefer it to reading the .hcr files. Thanks Neil

Re: [Haskell-cafe] Re: I just don't get it (data structures and OO)

2007-06-03 Thread Neil Mitchell
Hi You could also use 'compositional functional references'. These are introduced in the paper A Functional Programming Technique for Forms in Graphical User Interfaces by Sander Evers, Peter Achten and Jan Kuper. I've written a template haskell function to derive Refs from a data

Re: [Haskell-cafe] Ref and Derive

2007-06-03 Thread Neil Mitchell
Hi Speaking of Derive: I tried to install it just a few days ago, and failed. 'Derive' needed 'filepath-any', which needed 'directory-any', which I couldn't find (in Hackage or on Neil's website). Either: 1) Use GHC 6.6.1, which comes with filepath 2) Use the hackage version:

[Haskell-cafe] Template Haskell, information about data constructor types

2007-06-03 Thread Neil Mitchell
Hi I'm trying to write a function: reaches :: Type - Q [Type] The intention is that reaches (Either Bool [Int]) would return [Either Bool [Int], Bool, [Int], Int] - i.e. all types which are contained by the initial type at any level. I took a shot at this: getTypes :: Type - Q [Type]

Re: [Haskell-cafe] Failure in GHC compilation

2007-06-02 Thread Neil Mitchell
Hi Monique, Unless you REALLY need to, I'd recommend using the precompiled binaries on Windows: http://haskell.org/ghc/download_ghc_661.html Thanks Neil On 6/2/07, Monique Monteiro [EMAIL PROTECTED] wrote: Hi, has anyone any idea about what may cause the following error in GHC

Re: [Haskell-cafe] Haskell on a PDA (was Implementing Mathematica)

2007-06-02 Thread Neil Mitchell
Hi I seem to recall that Aarne Ranta ran Hugs on a (Sharp) Zaurus PDA at one of the ICFPs a few years back. Aha, here in fact is a picture of his GF (Grammatical Framework), written in Haskell, running on a Zaurus: http://www.cs.chalmers.se/~aarne/GF1/doc/zaurus2.jpg There seem to be

Re: [Haskell-cafe] RE: [Haskell] boilerplate boilerplate

2007-06-01 Thread Neil Mitchell
Hi Alex, The problem with Data.Derive is that I now have a pre-processor cycle as part of my build process. Automatic and universal Data and Typeable instance deriving should just be built into Haskell. Not if you use the template haskell support. We don't currently have a deriveAll command,

Re: [Haskell-cafe] Distributing a program with support files

2007-05-29 Thread Neil Mitchell
Hi Isaac Why? If it's a binary package, the IO will return the compiled-in path, which on the same distribution/whatever, should be the correct path. In particular, on Windows, I assume that the IO returns something that is in fact relative to the current position of the executable at the

Re: [Haskell-cafe] Distributing a program with support files

2007-05-28 Thread Neil Mitchell
Hi Duncan, list the support files in the data-files: stanza in the .cabal file. Then import the Paths_pkg module that Cabal generates for you. It exports a few functions including: getDataDir :: IO FilePath A few questions: 1) How do I test this? I'll need to develop in Hugs and GHC

Re: [Haskell-cafe] The C Equiv of != in Haskell

2007-05-28 Thread Neil Mitchell
Hi What is the C equivalent of the inequality operator in Haskell? /= You can answer these sorts of questions yourself using Hoogle: http://www.haskell.org/hoogle/?q=a%20-%3E%20a%20-%3E%20Bool Thanks Neil ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] The C Equiv of != in Haskell

2007-05-28 Thread Neil Mitchell
Hi You can answer these sorts of questions yourself using Hoogle: And what makes you think I haven't tried Google already? Hoogle, starting with 'H'. Follow the link I gave you, which is a search engine for Haskell functions, by type and name. If you search for a - a - Bool (a likely type

[Haskell] ANN: Data.Derive 0.1

2007-05-27 Thread Neil Mitchell
Hi I am pleased to announce Data.Derive. Webpage: http://www-users.cs.york.ac.uk/~ndm/derive/ Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/derive-0.1 Manual: http://www.cs.york.ac.uk/fp/darcs/derive/derive.htm From the Manual: Data.Derive is a library and a tool for

Re: [Haskell-cafe] Hugs

2007-05-27 Thread Neil Mitchell
Hi It's a shame really; the 2003 release of Hugs worked flawlessly. The new 2006 release has a much nicer UI, but... it behaves unpredictably. In particular, it has a habit of printing garbage instead of computation results. This is not in the bug tracker. Do you have a reproducible test

Re: [Haskell-cafe] Hugs

2007-05-27 Thread Neil Mitchell
Hi This is not in the bug tracker. Do you have a reproducible test case? I think I fixed one bug related to this a while back. Unfortunately it seems very intermittent. Sometimes it works fine, sometimes it just acts weirdly at me. It was a multithreaded/locking bug, the worst kind to

[Haskell-cafe] Distributing a program with support files

2007-05-27 Thread Neil Mitchell
Hi, I'm wanting to release a Haskell program, but am confused how I should distribute the associated files it needs. On Windows I would use the functions to find the path of the executable, and find the support files relative to that - in Haskell (because of Linux) that isn't the case. The

Re: [Haskell-cafe] System.Timeout problems

2007-05-27 Thread Neil Mitchell
Hi $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.6.1 -- TEST 2 import System.TimeoutGHC main :: IO () main = do r - timeout (length [1..]) (putStrLn here) print r Now, with either -threaded, or without, it never terminates. This is expected, as it

Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Neil Mitchell
HI For me, the unfortunate thing is that there seems to be no interpreter for Haskell written in Haskell. (Except for GHC, which is *huge*.) What do you mean by *huge*? Takes up to much memory at runtime? Requires too long to compile? Has had too many experts spending lots of time writing it?

Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Neil Mitchell
Hi I don't know about Linux, but Hugs is currently hopelessly unstable on Windoze. Have you filed bugs in the hugs bug tracker? No bugs have been filed from this. In general Windows and Hugs is rock solid, I use it every single day without issue - including to develop Yhc (an compiler). If

[Haskell-cafe] System.Timeout problems

2007-05-26 Thread Neil Mitchell
Hi I'm using the System.Timeout module from base, copied into my local repo, so that I can work with GHC 6.6.1. My copy is at: http://www.cs.york.ac.uk/fp/darcs/catch/catch_1/System/TimeoutGHC.hs (but it is identical to the one in base) Sadly, it doesn't seem to work for me. Here are the tests

Re: [Haskell-cafe] How to selectively export internal entities from a module for testing?

2007-05-24 Thread Neil Mitchell
Hi Thorkil, For possible guidance, I have looked at http://darcs.haskell.org/packages/filepath and System/FilePath/Internal.hs contains -- Note: leave this section to enable some of the tests to work #ifdef TESTING -- * Drive methods splitDrive, joinDrive, takeDrive,

Re: Avoiding CAF's

2007-05-23 Thread Neil Mitchell
Hi Simon, Ok, but suppose you get some good results - what's the point? None of this is guaranteed to work tomorrow. Why not aim for a robust translation into Core that preserves the semantics? It can't be that hard to pass around a State# RealWorld, can it? Is there a paper/document that

Re: [Haskell] boilerplate boilerplate

2007-05-23 Thread Neil Mitchell
:: Follow ups to haskell-cafe@ is probably best Hi Alex, {-# OPTIONS_DERIVE --derive=Ord,Eq,Read... #-} That would apply to all definitions in the module, so you don't have to repeat it for each type. You can attach a deriving annotation to each type individually, but that's obviously not what

[Haskell-cafe] Should do 1 compile

2007-05-23 Thread Neil Mitchell
Hi, As discussed on #haskell, the following code: module Foo where foo = do (1 :: Int) Compiles fine on Yhc, but doesn't on Hugs and GHC. GHC: Couldn't match expected type `t t1' against inferred type `Int' In the expression: (1 :: Int) In the

Re: [Haskell-cafe] Should do 1 compile

2007-05-23 Thread Neil Mitchell
Hi foo = do (1 :: Int) While intuitively this should be disallowed, it seems a pity that desugaring couldn't be totally separated from typechecking. Hmm. You can always desugar as: do x == return () x Although then you are relying on the Monad laws more than you possibly should. You

Re: [Haskell] boilerplate boilerplate

2007-05-22 Thread Neil Mitchell
Hi {-# OPTIONS -fglasgow-exts #-} module Blog.Types where import Data.Typeable import Data.Generics data BlogEntry = Entry EpochSeconds Name Email Title Body deriving (Eq,Ord,Read,Show,Typeable) newtype Name = Name String deriving

Re: Avoiding CAF's

2007-05-21 Thread Neil Mitchell
Hi case Main.$wccall GHC.Prim.realWorld# of wild_X28 { (# ds_d2ad, ds1_d2ac #) - i.e. it has had an artificial box put around the answer. It may be impossible to eliminate this, but if it is, I'd like to try. There's no actual box here. The ccall returns an unboxed tuple with two

isSpace is too slow

2007-05-20 Thread Neil Mitchell
Hi, I'm running a particular benchmark which calls isSpace a lot (basically wc -w). There are three ways to do the underlying space comparison - using the Haskell Data.Char.isSpace, using the C isspace, or using the C iswspace: isspace: 0.375 iswspace: 0.400 Char.isSpace: 0.672 Any chance

Re: isSpace is too slow

2007-05-20 Thread Neil Mitchell
Hi Want to try also the Data.ByteString.Base.isSpaceWord8 :: Word8 - Bool isspace: 0.375 iswspace: 0.400 ByteString: 0.460 Char: 0.672 Not as fast as isspace/iswspace, but quite a bit faster than Char. Perhaps someone needs to take a peek at the generated ASM for each of these routines

Re: Avoiding CAF's

2007-05-18 Thread Neil Mitchell
Hi Ian and Simon, Ian said: Does the boxing not get optimised out? Is the FFI imported function exported from the module? http://hpaste.org/1882 (replicated at the end of this message in case the hpaste is not around forever, but clearly layout and syntax colouring) Thats the main branch,

Re: Avoiding CAF's

2007-05-18 Thread Neil Mitchell
Hi http://hpaste.org/1882 (replicated at the end of this message in case the hpaste is not around forever, but clearly layout and syntax colouring) For completeness, the code in question is: Main.$wccall [NEVER Nothing] :: GHC.Prim.State# GHC.Prim.RealWorld -

Re: [Haskell-cafe] Short and sweet

2007-05-18 Thread Neil Mitchell
Hi Can anybody tell me what complexity class nub belongs to? nub requires Eq and not Ord, therefore you can prove that _any_ nub, no matter how good it is, must be O(n^2). Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Avoiding CAF's

2007-05-16 Thread Neil Mitchell
Hi, I'm trying to avoid CAF's being created, and I was wondering how is the best way to do it with GHC. For example: f = Can I attach {-# INLINE #-} to f, and expect the CAF to be removed that way? Is there any NOCAF annotation. I can always f _, then change the callers to f () - if I'm

Re: Avoiding CAF's

2007-05-16 Thread Neil Mitchell
Hi See this thread: http://www.nabble.com/%7B---INLINE-me_harder---%7D-tf3599366.html I'll try and see if I can do this with RULES. | foreign import ccall safe stdio.h getchar getchar2 :: CInt | | Can I stop this being CAF'd in any way? What is the problem you are trying to solve? I

Re: Avoiding CAF's

2007-05-16 Thread Neil Mitchell
Hi See this thread: http://www.nabble.com/%7B---INLINE-me_harder---%7D-tf3599366.html I'll try and see if I can do this with RULES. I remember the reason that was unsatisfactory now. The RULES only fire at high optimisation levels, whereas for this particular program the CAF/unCAF-ness of

<    3   4   5   6   7   8   9   10   11   12   >