Re: [Haskell-cafe] Haskell vs Ruby as a scripting language

2007-02-10 Thread Neil Mitchell
Hi Also, I recommend looking into embedding YHC. I have not had a chance to use it yet, but it looks like it is a better fit to an interpreter-only embedding situation than GHC--with GHC, you are getting a lot more than you seem to be asking for. I would want to compile code as well.

Re: [Haskell-cafe] Monolithic module tool

2007-02-08 Thread Neil Mitchell
Hi Chad I think what you are after is Haskell All-In-One: http://www.cs.utah.edu/~hal/HAllInOne/index.html As it happens, since that date Yhc has moved on to the point where: yhc Main.hs -linkcore loadCore Main.yca = writeFile Main.hs . coreHaskell Will get you a similar result - but with

Re: [Haskell-cafe] Portable implementation of unsafeCoerce

2007-02-06 Thread Neil Mitchell
Hi Alfonso, Reading the sources of Lava (a Haskell Hardware Description DSL) I run into this definition ... unsafeCoerce :: a - b Is this actually equivalent to the infamous unsafeCoerce# ? Yes, see the comment in the haddock documentation for unsafePerformIO:

Re: [Haskell-cafe] External Core

2007-02-06 Thread Neil Mitchell
Hi Ricky, For the last year I've been working on a program to translate between Haskell and Java. Originally this was for my third year dissertation to contribute towards my Masters in computer science at Sheffield University, UK. I have been given the opportunity to continue this project and

Re: [Haskell-cafe] how to calculate the sum of list of lists?

2007-02-05 Thread Neil Mitchell
Hi Miranda, How to calculate the sum of list of lists in Haskell? What do you mean by this? What is the value of a list? If you mean sum the numbers such that [[1,2],[3,4]] = 1+2+3+4 then you are able to ask two alternative questions - how do i convert a list of lists to a list, and how do i

Re: [Haskell-cafe] How to remove all numbers from a list that are divisible by an integer

2007-02-05 Thread Neil Mitchell
Hi Miranda, Now I need to know how to remove all numbers that are divisable by an integer. Is this a homework problem? Is there some bigger goal you are trying to achieve? I tried to use some zipWith...filter and other predefined functions..but I can't really find the right solution :(

Re: [Haskell-cafe] How to remove all numbers from a list that are divisible by an integer

2007-02-05 Thread Neil Mitchell
Hi Miranda, filter :: (a - Bool) - [a] - [a] filter p [] = [] filter p (x:xs) = if p 'mod' x then x : filter p xs else filter p xs I tried this, but it doesn't work You are mixing a few things together. First point, mod should be `mod` and not

Re: [Haskell-cafe] nested maybes

2007-02-04 Thread Neil Mitchell
Hi This is true. Some time ago I swore off the use of fromRight and fromLeft in favor of maybe, and have been forgetting about the other functions in Data.Maybe ever since. I think you mean you swore off fromJust. Unfortunately when people started to debate adding fromLeft and fromRight they

Re: [Haskell-cafe] Boost equivalent

2007-02-01 Thread Neil Mitchell
Hi John, Does the Haskell community have an equivalent to C++ community's Boost project with the aim of writing libraries for the eventual inclusion into Haskell? We have: 1) MissingH - a nice staging ground for things that may end up in the base library 2) Library submission process, to

Re: [Haskell-cafe] Circular programming (aka time-travel) resources?

2007-02-01 Thread Neil Mitchell
Hi Justin, A quick google search turned up a couple of blogs and some papers - but is there more out there? http://news.cs.york.ac.uk/ftpdir/pub/colin/jfp97lw.ps.gz Laziness, circularity and prime numbers all in one :) Thanks Neil ___

Re: [Haskell-cafe] Is Excel the most used -- and fucntional -- programming lanuage on Earth?

2007-01-30 Thread Neil Mitchell
Hi Alexy, Heard that statement recently -- that Excel is a functional programming language, and the most used one -- of any programming languages -- on Earth! Is it true? Are there good examples of typical FP style in Excel? You can't define functions in Excel, hence its not really a

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Neil Mitchell
Hi My standard solution was to invoke wget, but a Haskell solution would be nicer. For my purpose following redirects etc. isn't required, so thanks very much for your help. I will be releasing this function as part of a library shortly, so will be giving you credit for your help! Good

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Neil Mitchell
Hi So yes, we need to fix it. There's people to do it. Now we just need social factors to kick in and make it happen! We really do! The inability to get a file off a website is quite depressing given that the hard bit should be designing an API, but that anyone could do that for openURL in

Re: [Haskell-cafe] GHC-Cygwin

2007-01-29 Thread Neil Mitchell
Hi Daniil My desire is simple. I want GHC-Cygiwn. Why? I find Cygwin really really horrible and avoid it where possible. I was just wondering what advantages you get from having GHC-Cygwin? Thanks Neil ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Neil Mitchell
Hi Conrad, If the data header stores the alignment/size/endianness, then there's no reason for the data to be unportable. The normal get* instances (not get*host) could suffice for reading. That requires the stream to have a header. Which means that any arbitrary slice within the ByteString

Re: [Haskell-cafe] proposal: HaBench, a Haskell Benchmark Suite

2007-01-28 Thread Neil Mitchell
Hi What about using darcs as a benchmark? I heard people say it's slow. The undercurrent is that it's slow because it's written in Haskell. Its slow because some algorithms are O(stupid value). Some operations (I've been told) would take 100's of years to terminate. That has nothing to do

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-28 Thread Neil Mitchell
Hi Daniel, Adding in hPutStrLn h (Connection: close\r\n) or hPutStrLn h (Connection: keep-alive\r\n) as appropriate should sort that. Works like a charm. This is responding with a 302, the resource has been found but is temporarily at another location indicated in the responses Location

Re: [Haskell-cafe] Numeric Class Problem

2007-01-28 Thread Neil Mitchell
Hi Dennis, (/) :: Fractional a = a - a - a div :: Integral a = a - a - a Basically, use / on Float/Double like things, and div on Int/Integer like things: If you do want to use double like things throughout, then using fromInteger around the place will help: floor (fromInteger j *

Re: [Haskell-cafe] Converting Types to Terms

2007-01-28 Thread Neil Mitchell
Hi, I have got loads of requests to allow Hoogle to do this, usually something like if you search [Bool] - [Bool] it should suggest map not, or something - combining functions into the one you want. Unfortunately the search space would be huge for even the smallest library. Worse still, the

Re: [Haskell-cafe] What is the best way to understand large programs?

2007-01-28 Thread Neil Mitchell
Hi Haddock generates interface documentation. That's only appropriate for libraries, isn't it? Wrong, its very useful for normal programs as well. That along with a nice HsColour generated source links with Haddock and you can navigate the code just a bit quicker. Having a Hoogle database for

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-27 Thread Neil Mitchell
Hi Alistair, Is there a simple way to get the contents of a webpage using Haskell on a Windows box? This isn't exactly what you want, but it gets you partway there. Not sure if LineBuffering or NoBuffering is the best option. Line buffering should be fine for just text output, but if you

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-27 Thread Neil Mitchell
Hi Daniel Note that I haven't tried this, or the rest of Alistair code at all, so the usual 30 day money back guarantee doesn't apply. It certainly won't handle redirects. Thanks, it certainly gets more things, but has a nasty habit of taking a very long time in Hugs on certain URLs:

Re: [Haskell-cafe] Re: ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-27 Thread Neil Mitchell
Hi I also fear that the existing script does not handle types with more than 256 constructors correctly. While uncommon, those are not unrealistic. Feel free to send in a patch. All it needs to do is check if there are more than 2^8 constructors and if so encode the tag in a Word16 rather

Re: [Haskell-cafe] basic field questions

2007-01-25 Thread Neil Mitchell
Hi sq = squishiness $ Table {colour = Black, weight=1, height= 2} main = putStr $ show sq squishiness is just translated to: squishiness :: Furniture - Double squishiness (Chair _ _ x) = x squishiness _ = error doh main: No match in record selector Main.squishiness Hence this is a

Re: [Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-01-25 Thread Neil Mitchell
Hi I have to disagree with this. That is, I don't object to Don's explanation of why the shootout entries degraded in this particular case, but I do think that Andrzej was right to point this out: Perhaps making a collective effort towards benchmarking Haskell programs and analyzing the results

Re: [Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-01-25 Thread Neil Mitchell
Hi Sorry for being unclear. I agree with your comments on GHC, and one thing I was suggesting was that somebody should think about profiling tools for improving our understanding of how those transformations interact with each other, not just profiling tools for understanding the end result.

Re: [Haskell-cafe] Re: A function for Maybes

2007-01-25 Thread Neil Mitchell
Hi Alan, Usually, when I have a question like this, I try Hoogle first: http://www.haskell.org/hoogle/?q=%28a+-%3E+b%29+-%3E+Maybe+a+-%3E+Maybe+b Unfortunatly, the right answer (fmap) is on the second page of results. The reason for this is that Hoogle 3 doesn't understand higher-kinded type

Re: [Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-01-25 Thread Neil Mitchell
Hi Yhc has intermediate code that is substantially more Haskell like, and with the command: Wow, the core looks really cool! One look and you see it all. I would even rename the local variables to single letters like a,b,c because the cryptic numbers are quite hard to track. This is

Re: [Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-01-25 Thread Neil Mitchell
Hi Although there may not be a lot of optimizing Haskell compilers, there are compilers for languages similar to Haskell that consistently perform well. One could point to O'caml or others in the ML family, or even more interesting is the case of Clean, whose syntax heavily borrows from

Re: [Haskell-cafe] No Derived Read for Unboxed Arrays

2007-01-25 Thread Neil Mitchell
Hi, I was trying to convert some code from ordinary boxed array to unboxed arrays for performance reasons. However my code ultimately failed because I load a large array saved as a text file using the derived Read, Show mechanism. I found that Read was maybe 30 times slower than the

Re: [Haskell-cafe] No Derived Read for Unboxed Arrays

2007-01-25 Thread Neil Mitchell
HI Don (But of course, having Read/Show defined for UArray may well be useful, and sounds a good idea) There's also an instance Binary for UArray. That might be useful? Is there an instance Binary in a released library? Thanks Neil ___

Re: [Haskell-cafe] IO is not a monad (and seq, and in general _|_)

2007-01-23 Thread Neil Mitchell
Hi That's not quite what I was trying to say. (p^~p)-q is equivalent to _|_ in the sense that once you derive/compute (respectively) it, the world in which it exists breaks. I think thats a bit overly harsh view of _|_ to take. The world does not break once you compute _|_ - a _|_ value

Re: [Haskell-cafe] IO is not a monad (and seq, and in general _|_)

2007-01-23 Thread Neil Mitchell
Hi prove/compute anything you couldn't before. While removing _|_ from the language does make some things nicer to reason about, there aren't many corners where _|_ really gets in the way that much - seq being one of those few corners. But that is exactly the problem: `seq` forces _|_ to

Re: [Haskell-cafe] Strings in Haskell

2007-01-22 Thread Neil Mitchell
Hi Alexy, Now I'm reading a Haskell book which states the same. Is there a more efficient Haskell string-handling method? Which functional language is the most suitable for text processing? There are the Data.ByteString things, which are great, and have much less overhead. But remember

Re: [Haskell-cafe] Re: Article review: Category Theory

2007-01-19 Thread Neil Mitchell
Hi Brian, I've often wondered why seq is the primitive and not $! Would this solve the problem? Is there any solution that would allow excess laziness to be removed from a Haskell program such that Hask would be a category? class Seq a where seq :: a - b - b Then you have a different seq

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-18 Thread Neil Mitchell
Hi, I've often wondered the same as the above poster. Something like readWebPage (in the same style as readFile) would be a really handy function. Do no libraries provide this? (if not, can one start providing it? MissingH?) Thanks Neil On 1/18/07, Alistair Bayley [EMAIL PROTECTED] wrote:

Re: [Haskell-cafe] Article review: Category Theory

2007-01-18 Thread Neil Mitchell
Hi Isn't _|_ = \x - _|_? _|_ `seq` () = _|_ (\x - _|_) `seq` () = () Whether this is the fault of seq or not is your call... Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Article review: Category Theory

2007-01-16 Thread Neil Mitchell
Hi David, For some reason, in Firefox printing those diagrams to a black and white printer gives black for the background. It means that the arrows and annotations are in black on black, not the most readable... Any way to fix that? Perhaps uploading diagrams with white backgrounds, instead of

Re: [Haskell-cafe] Pattern matching

2007-01-15 Thread Neil Mitchell
Hi Stefan, myFunction x@(Constructor1 _*) = ... myFunction x@(Constructor2 _*) = ... myFunction x@(Constructor1 {}) = myFunction x@(Constructor2 {}) = myFunction2 (Constructor1 _* a _*) = ... could be possible as long as the pattern is non-ambiguous (in this case, only one variable with

Re: [Haskell-cafe] HaskellForge?

2007-01-08 Thread Neil Mitchell
Hi I.e. cabal + hackage + planet.haskell + weekly news ;) Does hackage actually allow a user to setup a new darcs repo on a remote server? That's about the only thing lacking - for everything else people can just use code.google.com, which is way better than anything any Haskell hacker would

Re: [Haskell-cafe] readFile problem

2007-01-08 Thread Neil Mitchell
Hi Stefan, I am writing a network server in haskell. Lately I seem to have introduced a new bug. On Linux, when a client closes the connection to the server, the server dumps core. Are you using any calls to system? Any libraries which may do funky stuff? application.exe: config.xml:

Re: [Haskell-cafe] trouble installing greencard -- -fno-prune-tydecls flag ( was Re: trivial function application question )

2007-01-07 Thread Neil Mitchell
Hi In the meantime, how about the following: In default non-verbose mode, silently memoize the list of packages that were not found. Then, only if something goes wrong, say something like: The package failed to build. Perhaps the reason is that one of the following packages was not found:

Re: [Haskell-cafe] trivial function application question

2007-01-04 Thread Neil Mitchell
Hi Brad, i have a small problem that will be certainly trivial for almost everyone reading this, i would appreciate a little help If you have trivial problems, its often useful to ask on Haskell IRC (http://www.haskell.org/haskellwiki/IRC_channel) from which my intent is that a be replaced

Re: [Haskell-cafe] Composing functions with runST

2007-01-03 Thread Neil Mitchell
Hi On the contrary, I think it's an excellent way of learning Haskell. I'm writing a lot of useful Haskell code with only one IO action (interact). I don't think I could reasonably construct an introductory problem that couldn't be solved with it, and I haven't yet found an application for

Re: [Haskell-cafe] Mo' comprehensions

2006-12-30 Thread Neil Mitchell
Hi I was solving some programming puzzles today[1], and found myself pining for Map comprehensions. [ ... (key,val) - fromList map, ... ] It isn't really that much more than a straight comprehension would be on a map. By default should a map comprehension let you inspect the values, or the

Re: [Haskell-cafe] Combine list of sorted lists

2006-12-29 Thread Neil Mitchell
Hi f1 :: [Int] - [[Int]] f1 [] = [] f1 (a:as) = [a] : f1 as f1 is simply a map f3 la lb = let a = head la b = head lb in if sum a = sum b then a : f3 (tail la) lb else

Re: [Haskell-cafe] Combine list of sorted lists

2006-12-29 Thread Neil Mitchell
Hi Quan I am not sure how to express f1 with map? how do I say (lambda (ls) (map (lambda (x) (list x)) ls)) in Haskell? map ([]) ? map (:[]), :[] takes a single element and puts it into a list. Some people refer to this as box The final f3 clause can be made a bit neater: f3

Re: [Haskell-cafe] Idiomatic Haskell equivalent of keyword arguments to functions

2006-12-29 Thread Neil Mitchell
Hi Paul, To make things concrete, the example I'm really thinking of is a send an email function, which would take a subject, a body, a list of recipients, optional lists of cc and bcc recipients, an optional mailserver (default localhost), an optional port (default 25), and possibly optional

Re: [Haskell-cafe] Is there a printable copy of the (GHC) library references anywhere?

2006-12-27 Thread Neil Mitchell
Hi Paul, You're right - if I think about it, I'm not really looking for the documentation, but more a paper or article which is a tour of the GHC standard library. A tour of the Prelude: http://undergraduate.csse.uwa.edu.au/units/230.301/lectureNotes/tourofprelude.html Only a few of the

Re: [Haskell-cafe] Re: Getting my feet wet - not in Haskell though

2006-12-24 Thread Neil Mitchell
Hi (There's still no good introduction to Monads, for example. One that's understandable for a programmer who knows his Dijkstra well but no category theory. And a few other things.) I grasped this one first time round: http://haskell.org/haskellwiki/Monads_as_containers No category theory.

Re: [Haskell-cafe] Re: How to serialize thunks?

2006-12-21 Thread Neil Mitchell
Hi All those libraries really force the data because they all are written in Haskell. If you want to serialize thunks then you will need some support from RTS. Good to hear that my conjectures aren't too far from reality. Does any Haskell implementation have that kind of RTS support?

Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Neil Mitchell
Hi there are really no choices for real development. many libraries, language extensions and techniques are for ghc only I develop everything in Hugs, including the Yhc compiler itself. Hugs is great. There are lots of extensions in GHC, but Haskell 98 is a perfectly useable language! So

Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Neil Mitchell
Hi In other words, you can program in Haskell just fine without extensions. But if you want that next level in type safety, extensions is where it's at, at least for the kind of code I write. What level of safety do these type extensions give you? The biggest runtime crasher is probably

Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Neil Mitchell
Hi In other words, what on earth is good about gluing oneself to Haskell98? Life's moved on... If you stick to Haskell 98 you can: * Convert your code to Clean (Hacle) * Debug it (Hat) * Run it in your browser (ycr2js) * Document it (Haddock) * Make a cross platform binary (yhc) * Get

Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Neil Mitchell
Hi True, though it would be even better if the usual extensions were more widely supported, though I suppose identifying what's useful and therefore worth supporting is the point of the Haskell Prime process. Exactly the reason for Haskell Prime. As an aside I've often thought it would be

Re: [Haskell-cafe] Versioning

2006-12-20 Thread Neil Mitchell
Hi Jo, You seem to be describing SYB and not knowing it: http://homepages.cwi.nl/~ralf/syb1/ That basically does exactly what you've requested, in terms of traversing all items when only one matters. That said, serialisation is still a hard problem - think long and hard before picking a data

Re: [Haskell-cafe] Re: Getting my feet wet - small browser game

2006-12-20 Thread Neil Mitchell
Hi Btw, if you're dumping large structures to disk, using Read/Show is a bad idea :) Just as a mention how bad it is, maybe 30 times at Show and 50 times at Read. I used to use this approach, moving away from it and learning how to use Drift was a good idea. Thanks Neil

Re: [Haskell-cafe] Re: Versioning

2006-12-20 Thread Neil Mitchell
Hi With Yhc.Core I used Drift to derve Binary instances, keep a version tag, and if the version tags mismatch refuse to load the data. Links? http://repetae.net/~john/computer/haskell/DrIFT/ http://darcs.haskell.org/yhc/src/libraries/general/Yhc/General/Binary.hs Thats Drift which can

Re: [Haskell-cafe] Data.Generics question

2006-12-19 Thread Neil Mitchell
Hi Mark, nested type, but to do that I seem to have to create a whole other near-copy of the data declarations with slightly different names and the occasional constructor missing. I wonder if there's a better way. Instead of getting the type system to enforce it, you can write annotations

Re: [Haskell-cafe] Re: A suggestion for the next high profile Haskell project [Was: Re: What is a hacker?]

2006-12-19 Thread Neil Mitchell
Hi Joachim, Why? In case the strictness analyzer was buggy? I'd be perfectly happy if that analysis were just a note saying run ghc with such-and-these options and inspect the intermediate code for function foo to see that the strictness analyzer determined it will always terminate. I

Re: [Haskell-cafe] Re: A suggestion for the next high profile Haskell project

2006-12-19 Thread Neil Mitchell
Hi Obviously when Cost(Upgrade) Cost(Optimisation) for the customer. Those costs are Cost(Upgrade) = Price of more memory or new PC which is fast enough. Cost(Optimisation) = Hours_spent * Fee_per_Hour / N You are talking closed source commercial software for the masses. I don't

Re: Re : [Haskell-cafe] Re: A suggestion for the next high profile Haskell project [Was: Re: What is a hacker?]

2006-12-19 Thread Neil Mitchell
Hi minh thu, Lazy semantics - equational reasoning ? I thought that : lack of mutable state - equational reasoning. For instance, I think to data flow variable in Oz (whcih I really don't know much / never used) : if a (Oz managed) thread attemps to read the value of an unbound (data flow)

Re: [Haskell-cafe] A suggestion for the next high profile Haskell project

2006-12-19 Thread Neil Mitchell
Hi I don't know if any actual language does this, What, that is strict and would like to inline things for performance? There is a reason they can't do this. but your inlining problem can be solved by letting _|_ = arbitrary behaivor. So would you allow folding? (inlining = unfolding)

[Haskell-cafe] Showing the 1 element tuple

2006-12-19 Thread Neil Mitchell
Hi, A weird question, what does the 1 element tuple look like? () -- 0 element tuple (,) a b -- 2 element tuple (,,) a b c -- 3 element tuple () a - meaningless (a) - a in brackets GHC has the 1 element unboxed tuple, (# a #), and all the other sizes unboxed as well, but how would you

Re: [Haskell-cafe] Showing the 1 element tuple

2006-12-19 Thread Neil Mitchell
Hi Python uses the syntax (foo,) to denote a singleton tuple (that is an extra comma at the end); quoting the python tutorial Ugly, but effective. Yes, I thought of that, the issue is: (a,b) is considered syntactic sugar for (,) a b (a,) is syntactic sugar for... And the place I'm

Re: [Haskell-cafe] Re: A suggestion for the next high profile Haskell project

2006-12-18 Thread Neil Mitchell
Hi Bulat, let's go further in this long-term discussion. i've read Shootout problems and concluded that there are only 2 tasks which speed is dependent on code-generation abilities of compiler, all other tasks are dependent on speed of used libraries. just for example - in one test TCL was

Re: [Haskell-cafe] Re: A suggestion for the next high profile Haskell project

2006-12-17 Thread Neil Mitchell
Hi, Is that an intrinsic feature of the language, or could compilers' optimisation plausibly get clever enough to do well without lots of seq and explicit unboxings and suchlike? I believe that compilers can get a lot cleverer - my hope is that one day the natural Haskell definition will

Re: [Haskell-cafe] I'd like start with Haskell, but...

2006-12-16 Thread Neil Mitchell
Hi Waldemar, The final aim of the aproach is to get a tool in which there will be no syntactic errors during modelling bussiness logic. Recently I've finished very primary version of the tool (0.001:-). Ah, now that sounds like Haskell might be good for :) Haskell isn't great at writing a

Re: [Haskell-cafe] Building the community

2006-12-14 Thread Neil Mitchell
Hi * Give tips on how to answer questions + Ok. we can put up an article here. Some suggestions: - No questions are bad questions - Code should come with examples of how to run it - Solutions with unsafePerformIO should be

[Haskell-cafe] Re: [Haskell] interpreter ouput in color

2006-12-14 Thread Neil Mitchell
Hi Walter, Hi all. I was wondering if some people miss the colored output of some applications, such like the IPython enhanced shell. I've been googling for similar options for Haskell but I found nothing. WinHugs already colours (to some degree) and hyperlinks error messages.

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-14 Thread Neil Mitchell
Hi Did you compile with -O (optimisations). Sometimes this fixes things, and its just good practice. It's slower to compile, and might fix things in GHC Haskell, but other compilers don't all have -O flags, so its generally best to make your program at least have the right sort of time/space

Re: [Haskell-cafe] Re: Haskell and .NET

2006-12-13 Thread Neil Mitchell
Hi Yhc also has a .NET generating capability, just pass the -dotnet flag. http://haskell.org/haskellwiki/Yhc Thanks Neil On 12/12/06, Monique Monteiro [EMAIL PROTECTED] wrote: Hi Justin, I've runned a research project about this topic (in fact, it was the subject of my MSc dissertation).

Re: [Haskell-cafe] Re: Micro-contributions to MissingH

2006-12-13 Thread Neil Mitchell
Hi I'm wondering if I should submit this as a patch for MissingH. If so, where in the new hierarchy should this be placed? I submitted 3 patches to missingh about a week ago, but have heard nothing back since. Did they get spam filtered or something? Thanks Neil

Re: [Haskell-cafe] Re: Haskell and .NET

2006-12-13 Thread Neil Mitchell
Hi Krasimir, to produce code with reasonable performance. The major problem with YHC is that it still doesn't have strictness analyzer. It does, or rather Yhc.Core does (see Yhc.Core.Strictness - http://www.cs.york.ac.uk/fp/yhc/snapshot/docs/Yhc-Core-Strictness.html). This was only done a few

Re: [Haskell-cafe] Re: Haskell and .NET

2006-12-13 Thread Neil Mitchell
Hi And strictness is not the biggest problem, a complete lack of any optimisations is, but I'm working on that one too! It is great to hear that. Of course an optimiser will be beneficial too but I guess that even the benefit that the code generator can have from the strictness analyzer will

[Haskell-cafe] Request for a Simple Pretty Printing library

2006-12-13 Thread Neil Mitchell
Hi, I've been using the HughesPJ pretty printing library, but I need a new combinator: wrap :: String - Doc - String - Doc wrap prepend doc append = ... The semantics of this would be that the text is prepended and appended to the doc when rendered, but does not alter the pretty printing at

Re: [Haskell-cafe] Request for a Simple Pretty Printing library

2006-12-13 Thread Neil Mitchell
Hi Something like: wrap prepend doc append = zeroText prepend doc zeroText append zeroText s = textBeside_ (Str s) 0 Empty Thanks, that works great! Is there likely to be any support for adding this to the standard library? I'd rather not have to fork a version of HughesPJ to get this

Re: [Haskell-cafe] Aim Of Haskell

2006-12-12 Thread Neil Mitchell
Hi That's exactly the problem! For most people there *is* no difference. You say functional programming to most people, even professional programmers, and usually the only chance you have of getting them to understand what what you mean is by asking so, have you heard of Lisp, or Scheme?

[Haskell-cafe] Pretty printing HTML

2006-12-12 Thread Neil Mitchell
Hi, I want to pretty print some text as HTML, using the standard HughesPJ combinators. The problem is that I want the length of a text string to be its textual context, not its character length. For example, a keyword will display as case, but internally will be the string span

Re: [Haskell-cafe] Refactoring recklessly

2006-12-12 Thread Neil Mitchell
Hi I'd like to be able to reorganize my code and then verify that I didn't change any functionality. That is, the old and new code have precisely the same meaning. Also, I'd like to be able to change a function and verify that efficiency was the only thing affected. Are either of these

Re: [Haskell-cafe] One question...

2006-12-09 Thread Neil Mitchell
Hi Waldmar, Now my problem is connected with the non-update object feature. I can't write variable instead object because - from the meaning of the word ( variable ) - it has the possibility to CHANGE its value. Yes that my problem :-( main = do username - read_info_from_user

Re: [Haskell-cafe] Download locations for former-base libraries?

2006-12-05 Thread Neil Mitchell
Hi Of course, just saying download the latest version with darcs isn't useful, either. People that want to use my package shouldn't have to have darcs, and they also shouldn't have to fight with broken development software. Or should I be telling people to download the GHC 6.6 extralibs

Re: [Haskell-cafe] GADT vs Arrows for parsers/FSMs/etc.

2006-12-05 Thread Neil Mitchell
Hi It seems like Haskell has two emerging idioms for parsing and fsms: GADTs and Arrows. What about something else? If you limit yourself to the two things that look new and cool (where emerging is another word for new, and idiom seems to be the current Haskell word for cool), you miss out on

Re: [Haskell-cafe] 2D Array

2006-12-03 Thread Neil Mitchell
Hi unsuitable. It seems that a Map Int (Map Int a) is the most suitable structure, but this seems cumbersome. You might want to use IntMap, which is a version of Map specialised to Int's, with better time bounds. Thanks Neil ___ Haskell-Cafe

Re: [Haskell-cafe] Haskell source transformer?

2006-11-30 Thread Neil Mitchell
Hi Dimitry, I know there is a Haskell syntax parser around (maybe, more than one). Does anybody know of any utility based on such parser that does things I need, or rather a library on top of the parser? I just would like to avoid reinventing the wheel. I have a Haskell parser here:

Re: [Haskell-cafe] New Name for MissingH?

2006-11-30 Thread Neil Mitchell
Hi The alternative I've been thinking of is something like Haskell Utility Library (HUL). Yuk. I like MissingH. MissingH suggests things that are missing from the standard set and provided here. HsMissing would be my preferred choice, but its not really important. Haskell says which language

Re: [Haskell-cafe] Re: New Name for MissingH?

2006-11-30 Thread Neil Mitchell
Hi I couldn't figure out how to add it to hoogle. Does anyone have a pointer for that? Wait for Hoogle 4, and bug me. Hoogle 4 will allow additional libraries to be searched. Once its ready I'll add MissingH. database would probably help, along with greater there is a function for that

Re: [Haskell-cafe] Building Binaries with Cabal

2006-11-30 Thread Neil Mitchell
Hi let mydescrip = case System.Info.os of mingw32 - descrip _ - descrip {buildDepends = Aghhh! To test if the operating system is windows you compare against a hard coded string which _isn't_ an OS, but _is_ an optional component by

Re: [Haskell-cafe] Building Binaries with Cabal

2006-11-30 Thread Neil Mitchell
Hi Your point is well-taken, but the distinction is useful. If running on cygwin, my platform is essentially POSIX, even though the OS is Windows. Yes, but _my_ OS is reported as mingw32, even though its never been installed on this computer... Thanks Neil

Re: [Haskell-cafe] generating javascript

2006-11-29 Thread Neil Mitchell
Hi Jeff, It all depends how you want to write your code. The two options are full Haskell (Yhc) or combinators (HSPClientSide). Thanks Neil On 11/29/06, jeff p [EMAIL PROTECTED] wrote: Hello, There's a Google SoC-project made by a friend of mine for JavaScript support in Haskell Server

Re: [Haskell-cafe] generating javascript

2006-11-29 Thread Neil Mitchell
Hi Anyway I encourage you to have a look at HSP as well :-) It's quite nice to be able to use regular XML syntax within the Haskell code. I think it should be entirely possible to use Haskell with Yhc and HSX (http://www.cs.chalmers.se/~d00nibro/haskell-src-exts/), so you can still write

Re: [Haskell-cafe] The Future of MissingH

2006-11-24 Thread Neil Mitchell
Hi John, Should this all be one library? No, several smaller libraries would be nice. Should the module naming scheme be changed? Yes, MissingH is not the place to put these things. You run the risk of more name clashes, but thats ok. Could, and should, any of this be integrated into

Re: [Haskell-cafe] The Future of MissingH

2006-11-24 Thread Neil Mitchell
Hi How could greater community participation be encouraged, while still encouraging quality control? It also took me quite a while to find the darcs repository, and as far as I can see there is no web page on what MissingH has in it, other than a textual readme and the GNU entry. If there

Re: [Haskell-cafe] Arrows tutorial

2006-11-19 Thread Neil Mitchell
Hi Small arrows tutorial (sorta, I'm learning myself and trying to doc as I go): http://www.thenewsh.com/~newsham/x/arrow.txt Why not shove it on the wiki? Then everyone can find it, improve it, and treasure it forever more. Thanks Neil ___

Re: [Haskell-cafe] Wiki page for rewrite rules tips, types and tricks

2006-11-18 Thread Neil Mitchell
Hi Great page, I especially like the phrase: [...] changing a non-terminating program [...] into a much faster one [...] And one important point: In general its a bad idea for rules to change the semantics (meaning) of your code in such a way. Consider someone using reverse . reverse to

Re: [Haskell-cafe] importing Distribution.Compat.FilePath fails

2006-11-18 Thread Neil Mitchell
Hi How about using this instead: http://www-users.cs.york.ac.uk/~ndm/projects/libraries.php#filepath The only reason would be that it isn't in my GHC install by default (I'm on Debian Sid). However, I suppose I can look at this as an excellent first experiment with Cabal and packaging Haskell

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-17 Thread Neil Mitchell
Hi How controversial would a proposal to {-# DEPRECATE fromJust #-} be, in favour of: Just _ = x -- which will give you the precise line number It seems to me this is one cause of mysterious newbie errors we could easily discourage, with little harm. Btw, I'm not seriously

Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-15 Thread Neil Mitchell
Hi I have always been wondering why error shouldn't always return a call stack from the occurrance of fromJust up to the function I typed into ghci (or up to main, for that matter). yhi-stack (as yet unreleased) does exactly this, without requiring you to recompile your code even. hat-stack

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-15 Thread Neil Mitchell
Hi Yes, these techniques are fairly well known now, and hopefully some of the more experienced Haskellers are using them (I certainly use the non-empty list tricks). Any anyone with more than 6 months Haskell knows to avoid fromJust. I'm not, I use fromJust all the time. Ditto for head, init,

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-15 Thread Neil Mitchell
Hi Should Haskell also provide unrestricted side effects, setjmp/ longjmp, missile launching functions, etc? After all, people who don't want to use them can just avoid them. :) Fair point. But if you eliminate incomplete cases, and the error function, you'd probably need to increase the

<    3   4   5   6   7   8   9   10   >