Re: [Haskell-cafe] Automatic derivation (TemplateHaskell?)

2007-04-05 Thread Neil Mitchell
Hi Sorry for the late multiple reply, I just spent seven hours sleeping... And ditto for my delayed reply - I've just spent 9 hours in a car on a motorway :) I am not the maintainer of Data.Derive, nor did I write the majority of the nice code; Neil Mitchell did it, you can ask him

Re: [Haskell-cafe] Re: Re: Why the Prelude must die

2007-03-28 Thread Neil Mitchell
Hi > Regarding type variable naming, a few of my more hardware minded > friends I've asked to try Haskell often tease me about the opaque type > variable names in the Prelude--it seems greater consideration of type > variable names in the Prelude might behoove new users. I think that single let

Re: [Haskell-cafe] Why the Prelude must die

2007-03-25 Thread Neil Mitchell
Hi > Yes. It will break 100's of applications. That sounds like a challenge! Find me 100 applications that use Data.Map.map and I will eat crow. http://www.google.com/codesearch?hl=en&q=+lang:haskell+Map.map&start=10&sa=N Since most people import qualified Data.Map as Map. Not all of those

Re: [Haskell-cafe] Why the Prelude must die

2007-03-25 Thread Neil Mitchell
Hi At any rate, since Map is a Functor, I vote for Data.Map.map to be deleted. Any disagreements before I submit the ticket? Yes. It will break 100's of applications. If you are going to do this, you probably need to propose it be marked as depreciated, and then deleted sometime years into t

Re: [Haskell-cafe] Why the Prelude must die

2007-03-24 Thread Neil Mitchell
Hi Reducing to just haskell-cafe - since this isn't yet a concrete proposal - more just a discussion. 1. Namespace pollution Do you want to overload (.) ? I think its good that some names mean standard things. Maybe not as many as the prelude, but some standard things are good. This is a h

Re: [Haskell-cafe] Application of iterate

2007-03-23 Thread Neil Mitchell
Hi ? Of course, I would like to get indexed in haskell.org/hoogle - but how to do that? Wait for Hoogle 4, sadly. Once thats done, by adding your package to hackage you'll be indexed by Hoogle. Thanks Neil ___ Haskell-Cafe mailing list Haskell-Ca

Re: [Haskell-cafe] Application of iterate

2007-03-23 Thread Neil Mitchell
Hi > I don't know how to add it into the one liner though - although I > suspect someone here will :) head . head . filter (\(x:y:_) -> abs (x-y) < 0.1) Doesn't work, I assume you meant (and typo'd): head . head . filter (\(x:y:_) -> abs (x-y) < 0.1) . tails Which does work fine. Thank

Re: [Haskell-cafe] Application of iterate

2007-03-23 Thread Neil Mitchell
Hi Longesh But I've found learning Haskell so tough (this is my 4th try in the last two years) that I feel I have to bore everyone with my first non-trivial program. Well done on getting something going! my_sqrt t = last (take 20 (iterate (\n -> n/2 + t/(2 * n)) t)) last (take 20) can be r

[Haskell-cafe] Re: [Haskell] Summer of Code project proposal

2007-03-19 Thread Neil Mitchell
Hi Nikhil, haskell-case is probably a better choice of list for this - haskell is more for announcements. > I am Nikhil N, a third year Computer Science student from India. I am looking at building a good IDE for people learning Haskell(as part of SoC).This IDE will be modeled on Dr Scheme

Re: [Haskell-cafe] Mixed-type arithmetic, or type coercion

2007-03-13 Thread Neil Mitchell
Hi Arithmetic operators in haskell appear to require their operands to have the same type. How can I do arithmetic between operands of different types? You probably don't want to. Alternatively, how do I coerce a value from being an Int to being a Double? You ask Hoogle: http://haskell.

Re: [Haskell-cafe] Re: Maybe and partial functions

2007-03-13 Thread Neil Mitchell
Hi Nicolas, It seems like we could refine the first parameter of carryPropagate just as the second: make an= type N1 that only admits values [1..]. How? newtype N1 = N1 Int (put that in a module and don't export N1) define the constant 2, define the increment operator, change div and mod. N

Re: [Haskell-cafe] Re: Maybe and partial functions

2007-03-13 Thread Neil Mitchell
Hi Note: Total = total ignoring non-termination, for this post Surely we can assume them total given that base is never zero? They are not total, they are called in a manner which does not cause them to raise an error. If you want every function to be total, you need to fix div. If you are h

[Haskell-cafe] Re: Maybe and partial functions

2007-03-13 Thread Neil Mitchell
Hi -- There are no pattern-matching failures here. -- The totality is harder to see: all digits are roughly of the same range, -- but each recursive call increments base. Eventually, base becomes bigger -- than d+9 and so the first alternative will be selected, which is in the -- WHNF and so rec

Re: [Haskell-cafe] Maybe and partial functions

2007-03-12 Thread Neil Mitchell
Hi > head [] return Nothing? I guess it's a bit of a silly suggestion, but it helps to highlight why we use Maybe in the first place. So --- where's the cutoff point in your code? If that is what you want, then see my Safe library: http://www-users.cs.york.ac.uk/~ndm/projects/libraries.php#sa

Re: [Haskell-cafe] Performance Help

2007-03-12 Thread Neil Mitchell
Hi I notice that there's not much user-accessible documentation of what you can expect GHC (or some other Haskell implementation) to do and not do with a given piece of code. Yhc/nhc/Hugs - nothing GHC - inlining, simplification, fusion if you use the build in functions in a specified way, st

[Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-09 Thread Neil Mitchell
Hi I note that the deadline for discussion of System.FilePath has now passed (well, a long time ago :-), so it looks like it's going into base. Any final objections before we do this? The deadline passed before Christmas, and no one objected. I still intend to move it in to base, I just haven

Re: feature request: indexing Haskell projects (Re: [Haskell-cafe] auto-completion for Vim 7)

2007-03-09 Thread Neil Mitchell
Hi i noticed that you often reply to feature requests by pointing to undocumented tools/features, either already released in secret, or forthcoming. not that it isn't nice to have those tools, but won't you lose track of your software and its capabilities at this rate (not to talk about your cu

Re: [Haskell-cafe] A different Maybe maybe

2007-03-07 Thread Neil Mitchell
Hi For a while I have been thinking: Isn't there a way to get rid of the intermediate Maybe construct in a common expression like "fromMaybe default . lookup". It seems that a way to do that would be to pass more information to the Maybe-generating function: What to do with a Just-Value, and wha

Re: [Haskell-cafe] Google summer of code

2007-03-06 Thread Neil Mitchell
Hi It appears that you need to be logged in to edit the page, and I couldn't find/guess any appropriate passwords. How do we log in? But registering works fine, so thats the way to go. So many tracs, so many rules, and I'm still confused. Thanks Neil _

Re: [Haskell-cafe] Google summer of code

2007-03-06 Thread Neil Mitchell
Hi Malcolm, Well, our wiki to gather ideas is now up-and-running again: http://hackage.haskell.org/trac/summer-of-code It appears that you need to be logged in to edit the page, and I couldn't find/guess any appropriate passwords. How do we log in? Thanks Neil ___

Re: [Haskell-cafe] LGPL libraries

2007-03-05 Thread Neil Mitchell
Hi Gtk2Hs and HDBC are both LGPL licensed, but aren't they always static linked? Is there a way to use them in closed-source programs? If you are concerned about static linking, Yhc may offer a solution, since it produces bytecode files, which don't statically link to anything. Of course,

Re: [Haskell-cafe] Safe top-level IORefs

2007-03-04 Thread Neil Mitchell
Hi On 3/4/07, Roberto Zunino <[EMAIL PROTECTED]> wrote: I'm posting the code of a module, IORefs, allowing top-level IORefs to be safely declared and used. Usafety reports are welcome. Tested in GHC 6.6. That looks cool, does it work on Hugs? Thanks Neil ** Features: 1) IORef a provided

Re: [Haskell-cafe] auto-completion for Vim 7

2007-03-04 Thread Neil Mitchell
Hi Claus, Neil: is there any documentation on the output format? i couldn't find the flag in the haddock manual, so i was surprised to see it in haddock --help; it works, though, and does seem to generate modules with implementations removed, and some declarations simplified? Documentation isn

Re: [Haskell-cafe] Re: auto-completion for Vim 7

2007-03-04 Thread Neil Mitchell
Hi I tried that but I guess I was too impatient to figure out what exactly haddock wants (it seemed to choke on #ifdefs), so I just used the hoogle.txt from darcs and ran it through sed. Haddock can't cope with #ifdef's, or .lhs files - haddock-ghc will be able to (the next version), so hopefu

Re: [Haskell-cafe] auto-completion for Vim 7

2007-03-04 Thread Neil Mitchell
Hi If someone knows of a simple way to generate a function/type list of the standard modules, I'd love to hear about it. Generating such a list on the fly each time is probably not an option, as it would be too slow. Using a recent version of haddock, the --hoogle flag gives you exactly what y

Re: [Haskell-cafe] Lambdabot on Windows?

2007-03-03 Thread Neil Mitchell
Hi > The darcs repo version of lambdabot does run on windows. you'll need to > remove the unix dependency from the .cabal file. At least 2 people have > had it working. Anyone have some binaries they want to share? I keep some binaries at http://www-users.cs.york.ac.uk/~ndm/projects/windows.p

Re: [Haskell-cafe] ANN: HSH 1.2.0

2007-03-03 Thread Neil Mitchell
Hi There are a couple of things about that function... First, I did see it, but its description is rather vague on what it does. From the description, it sounds like it is possible that it would not return an absolute path; I read it more as expanding symlinks. If it does indeed return an abs

Re: [Haskell-cafe] ANN: HSH 1.2.0

2007-03-03 Thread Neil Mitchell
Hi FilePath is indeed quite nice. You might also want to look at System.Path and its submodules in MissingH (API docs at [1]). I've got some stuff that FilePath doesn't, namely making paths absolute, wildcard matching/globbing, and also a function that converts a POSIX wildcard into a regexp.

Re: [Haskell-cafe] Proposal: simple interface to libraries Haddock

2007-03-02 Thread Neil Mitchell
Hi And when will Hoogle 4 be more than vapourwear? :) I guess the answer is 'whenever people stop asking me and start contributing patches' ;) Patches are not what I need, since all the ideas/designs are in my head. I'll try and get somewhere on it soon, but my time is pretty well booked for t

Re: [Haskell-cafe] Proposal: simple interface to libraries Haddock

2007-03-02 Thread Neil Mitchell
Hi David, I realise it's similar. I don't they fulfill quite the same aim though. Hoogle might give me two dozen results when I roughly know the name of a function, but this isn't what I want. hoodoc doesn't, it gives you the exact result. The main reason this is hard at the moment, incident

Re: [Haskell-cafe] Proposal: simple interface to libraries Haddock

2007-03-02 Thread Neil Mitchell
Hi David, I'm proposing something simple that should make it easier for both Haskell programmers and Haskell tool writers to find the documentation for a function. We need a simple URL for the Haddock docs of any function. PHP has this already: just hit php.net/funcname for the documentation for

Re: [Haskell-cafe] Re: OO Design in Haskell

2007-03-01 Thread Neil Mitchell
Hi forgive my ignorance but I thought functional programming was a mathematically sound framework unlike Object Oriented programming. Referentially transparent is a better term than mathematically sound here. This is the property that x = y means that instances of x can be replaced with y. I

Re: [Haskell-cafe] Literate haskell format unclear (implementation and specification inconsistencies)

2007-02-28 Thread Neil Mitchell
Hi Isaac Trying to implement literate haskell[*], I realized several ways in which the correct behavior for unliterating (especially with regard to errors) was unclear. I have several cases which ghc, hugs and Haskell 98 have differing opinions on! The Report as it stands is far from a clear a

Re: [Haskell-cafe] What inhabits this type: (forall a. a -> b) -> (forall a. m a -> m b)

2007-02-27 Thread Neil Mitchell
Hi I have looked on Hoogle. I would have asked Djinn, but I don't have it around. So, can someone find a term that inhabits (forall a. a -> b) -> (forall a. m a -> m b) Asking hoogle about rank-2 types won't get you very far, the development version of Hoogle gives a warning that it ignores

Re: [Haskell-cafe] Safe lists with GADT's

2007-02-27 Thread Neil Mitchell
Hi Coq does have termination checking, and Neil Mitchell is working on a case-and-termination checker for Haskell. I was working on a case and termination checker. Now I'm just working on a case checker (which is pretty much done). The main reason I gave up on termination is that it was

Re: [Haskell-cafe] How you can help improve Haskell implementations!

2007-02-26 Thread Neil Mitchell
Hi And also I guess the compilers will do more optimisations, etc. So this suggests an obvious extra feature for nobench which would be the ability to view a graph of each compiler's performance over a period of time, obviously this probably wouldn't be useful for at least a few months. We hop

Re: [Haskell-cafe] Safe lists with GADT's

2007-02-25 Thread Neil Mitchell
Hi Stefan, Since we don't know in advance the length of the list, we need an existensial type; this immediately causes problems because existential types do not exist in any current Haskell implementation. There are two approaches: -- Using an existential datatype box data VarList a = foral

[Haskell-cafe] Safe lists with GADT's

2007-02-25 Thread Neil Mitchell
Hi I'm starting to play with GADT's, and I was trying to write a safe version of head and tail, on a safe version of lists. What I came up with is: data ConsT a data NilT data List a t where Cons :: a -> List a b -> List a (ConsT b) Nil :: List a NilT instance Show a => Show (List a

Re: [Haskell-cafe] How to build a generic spreadsheet?

2007-02-23 Thread Neil Mitchell
Hi I want to write a program where a user would update a bunch of variables, and everything that depends on those variables (and nothing else) are recalculated. Basically, a spreadsheet, but generalized for any computation. Could someone recommend an elegant way to do it or some good reading m

Re: [Haskell-cafe] exists . a psuedo-standard non-empty list module

2007-02-23 Thread Neil Mitchell
Hi Incidentally, inserting NList into the existing Safe.List does not seem like a good match as NList critically relies on being in a separate module with a limited export. As mentioned before, Safe.List would be an entirely separate module in my package, so can export/not export whatever it c

Re: [Haskell-cafe] exists . a psuedo-standard non-empty list module

2007-02-23 Thread Neil Mitchell
Hi Nick That sounds like a great option. Candidate numero uno as of now. What I have in mind right now should be pretty light weight, but it will mostly be a regurgitation of code I've seen floating around. Some of the code from the previous wiki link, type-level decimal numbers I saw in an Oleg

[Haskell-cafe] Re: Leaves of a Tree

2007-02-22 Thread Neil Mitchell
Hi Chad, I think this idea is better than what I had suggested, but as it stands it doesn't typecheck. Did you mean something like this? Yep, just the type signature was wrong :) leaves :: Tree -> [Int] leaves = f [] where f rest (Leaf n) = n : rest f rest (Branch l r) = f (f r

Re: [Haskell-cafe] Leaves of a Tree

2007-02-21 Thread Neil Mitchell
Hi Tom data Tree = Branch Tree Tree | Leaf Int deriving (Eq, Ord) leaves :: Tree -> Set Int leaves (Leaf n) = singleton n leaves (Branch left right) = union (leaves left) (leaves right) The standard method for a traversal over leaves with accumulation is: leaves :: Tree -> Set Int leaves x

Re: [Haskell-cafe] exists . a psuedo-standard non-empty list module

2007-02-21 Thread Neil Mitchell
Hi IMHO I think that isJust/fromJust could simply be removed. Using 'maybe' is a much better practice, it is safe and much even more expressive. Yes, its more expressive if you let someone write (error "Umm, what should I do here?") as one of the options. And now you've gone from something wit

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

2007-02-21 Thread Neil Mitchell
Hi pidigits is not (currently) one of the nofib programs (phew :-). Shame... I suppose the reason for the results is because the test spends most of its time in GMP? Taking a brief look that does indeed appear to be true. I don't think there could be any other reason for Yhc getting so clo

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

2007-02-21 Thread Neil Mitchell
Hi Simon Benchmarks please! Let's see some comparisons on the nofib suite. If there's a factor of 2 or less between GHC -O2 and YHC for any of the nofib programs, I'll eat my keyboard for lunch :-) http://www.cse.unsw.edu.au/~dons/nobench/bench.results Test: pidigits (lazy, arbitrary preci

Re: [Haskell-cafe] ANNOUNCE: nobench: Haskell implementaion benchmarks. GHC v Hugs v Yhc v NHC v ...

2007-02-19 Thread Neil Mitchell
Hi Well, he was willing to make concessions for Yhc brokenness (wrt importing System.Environment - yhc's System doesn't export getArgs like the Report says it should (first tangible result of nofib: the Yhc team has fixed it)) The second tangible result should be that Yhc runs faster than nhc.

Re: [Haskell-cafe] GHCi and multi-line support ?

2007-02-19 Thread Neil Mitchell
Hi > Is it possible to write multi-line definitions in GHC interactive interpreter ? (like in Python interp. ?) As it happens, it is possible to do with WinHugs, I've just never turned it on by default. If there is massive need I'll polish this feature up and put it in the next builds. Thank

Re: [Haskell-cafe] ANNOUNCE: nobench: Haskell implementaion benchmarks. GHC v Hugs v Yhc v NHC v ...

2007-02-19 Thread Neil Mitchell
Hi Dons, nobench http://www.cse.unsw.edu.au/~dons/nobench.html Yhc is consistently half the speed of nhc, whereas in our tests, its typically 20% faster. Can you make sure you've built Yhi with -O (scons type=release should do it). I opened a bug just a few days ago, because I realise

Re: [Haskell-cafe] How to solve this problem?It's quite easy in PHP.

2007-02-14 Thread Neil Mitchell
Hi Don, Type :? for help Hugs.Base> :l Text.Printf Text.Printf> printf "%d" (1::Int) :: String "1" My bad - sorry, too many presentations/papers were people encoded printf using multi-ranked-generalised-associated types :) Fix Yhc! Fair point, should be as simple as compiling that file...

Re: [Haskell-cafe] How to solve this problem?It's quite easy in PHP.

2007-02-14 Thread Neil Mitchell
Hi Eeek, a solution that does monadic maps and require's rank 2 types! arr = [('a',1), ('b',2), ('c',3)] showAll = lines (map showItem arr) showItem (a,n) = a : " = " ++ show n main = putStr showAll I've broken this up a bit more than usual - most people would probably just put showAll inside m

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

2007-02-13 Thread Neil Mitchell
Hi Simon, > Yhc can happily compile code and run it. You'll probably pay a factor > of 2-8 times slower than GHC, depending on what the code does. Benchmarks please! Let's see some comparisons on the nofib suite. If there's a factor of 2 or less between GHC -O2 and YHC for any of the nofib pr

Re: [Haskell-cafe] GHC throws IOError on Win32 when there is no console

2007-02-11 Thread Neil Mitchell
Hi Good point. Perhaps you can persuade the people who look after GHC on win32 to have it use the Windows debug log service for exception messages like that when there's no GUI available. Of course if you can code up and submit such a patch yourself then even better. Does anyone read that? Wou

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 we

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

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] 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: http://haskell.org/ghc/doc

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 n

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 :( Can

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] 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] "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 ___ Haskell-Cafe

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 add

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 functio

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 is

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 Haskell-Cafe@has

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

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! Goo

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] 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 sec

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 * (fromI

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 Locat

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 with

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 t

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: researc

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

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 ___ Haskell

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 slowest

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 Haskell.

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 somet

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 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. T

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] 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 patt

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 _|_

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 do

Re: [Haskell-cafe] Monomorphism restriction

2007-01-23 Thread Neil Mitchell
Hi This should clear up some of the questions: http://haskell.org/hawiki/MonomorphismRestriction Note to others (esp Cale): does this page not appear on the new wiki? Thanks Neil On 1/23/07, Marco TĂșlio Gontijo e Silva <[EMAIL PROTECTED]> wrote: Hello, I talked for a while with bd_ about t

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 that

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] 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] 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-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 t

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 t

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: openFil

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 e

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 whic

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] Literate Haskell source files. How do I turn them into something I can read?

2006-12-30 Thread Neil Mitchell
Hi Michael, cpphs is the answer: http://www.cs.york.ac.uk/fp/cpphs/ It has a --unlit mode, and if one of the other flags doesn't remove the various forms of line dropping, I'm sure if you posted what you need doing, contacted the author or submitted a patch that someone would be able to do it. I

<    3   4   5   6   7   8   9   10   11   >