[Haskell-cafe] PROPOSAL: Rename haskell@ to haskell-announce@

2007-09-23 Thread Neil Mitchell
Hi I've just replied to another first poster with "wrong list". Its entirely not their fault, but its also probably a bit off-putting that your very first post gets a (very polite) "you got it wrong" message. To steal the reasons and explanations from Ian: - pretty much what

[Haskell-cafe] Re: [Haskell] Math behind Haskell

2007-09-23 Thread Neil Mitchell
Hi The haskell-cafe@ mailing list is more appropriate for messages such as this. haskell@ is just for announcements (it should be called haskell-annouce@ !) > * Lambda calculus - the basis of functional languages > > * Category theory - where all these mysterious things like monads, > arrows, a

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-23 Thread Neil Mitchell
Hi > I'm not sure, but since it would require the detection of an evaluation > that does not terminate, it comes down to the halting problem, which is > not generally solvable. Maybe the experts can confirm my intuition? I think your intuition is off. This isn't the problem of detecting that a c

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Neil Mitchell
Hi > f = f > > and then try to evaluate 'f' in GHCi, as one would expect, the interpreter > never returns an answer. > > The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't > seem to use any CPU time at all. It's called a black hole. The runtime can detect that f directl

Re: [Haskell-cafe] GHC 6.7 on Windows / containers-0.1 package?

2007-09-21 Thread Neil Mitchell
> > All dependencies etc. have changed when going to 6.7/6.8 - you are > > probably better off using 6.6.1 for now. > > > That's a petty. I really would like to experiment with the debugger :-) Me too! A proper release of GHC 6.8 is very nearby, so you should get your wish then. Thanks Neil

Re: [Haskell-cafe] GHC 6.7 on Windows / containers-0.1 package?

2007-09-19 Thread Neil Mitchell
Hi Peter, > So I grabbed ghc-6.7.20070824 (=the latest one for Windows I could find) > and the "extra-libs", compiled and installed the GLUT package (which I > needed), but when I compile my library, I get > > Could not find module `Data.Map': >it is a member of package containers-0.

Re: [Haskell-cafe] (win)hipe for Haskell?

2007-09-19 Thread Neil Mitchell
Hi > > Yes, Hat does this http://www.haskell.org/hat/ (if you can get it to > > work, I typically have little success) > > > > Thanks. WinHIPE uses graphics and animation. If briefly encountered Hat > before, but I had the impression it did not visualize the graphs using > graphics, only text. Is

Re: [Haskell-cafe] (win)hipe for Haskell?

2007-09-19 Thread Neil Mitchell
Hi Peter, > During a googling session, I can across (Win)HIPE, a visualization program > for the functional language HOPE. See > http://dalila.sip.ucm.es/~cpareja/winhipe > > IMHO a similar tool would be a nice for learning/teaching Haskell; does > that exist, or something else that comes close?

Re: [Haskell-cafe] Why isn't pattern matching lazy by default?

2007-09-19 Thread Neil Mitchell
Hi > > Now why isn't pattern matching lazy by default? This seems odd for a > > newbie since everything else is lazy by default. f ~(x:xs) = rhs f ~[] = rhs' Now guess what f [] does... If you use a where binding then pattern matching is lazy. Thanks Neil ___

Re: [Haskell-cafe] help me ! who has vty ?

2007-09-19 Thread Neil Mitchell
Hi > who has vty for haskell? > I can't find the right one so who can mail one to me ? http://hackage.haskell.org/cgi-bin/hackage-scripts/package/vty-3.0.0 hackage has a lot of packages, and is always a good place to start a search. Thanks Neil ___ H

Re: [Haskell-cafe] Building "production stable" software in Haskell

2007-09-18 Thread Neil Mitchell
Hi > okay, but this fails in some cases. i wrote a package to obtain > financial quotes. yahoo changed the webservice url on me. i rolled out > a change within a day. in your model, people suffer a broken service > for two weeks. I don't think Yahoo will change the syntax or semantics of filepath

Re: [Haskell-cafe] unique id for data types

2007-09-18 Thread Neil Mitchell
Hi Barney, This may be of interest, since all types already have an Int associated with them: http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#v%3AtypeRepKey Thanks Neil On 9/18/07, Barney Hilken <[EMAIL PROTECTED]> wrote: > In order to make my records system practica

Re: [Haskell-cafe] Library Process (was Building "production stable" software in Haskell)

2007-09-18 Thread Neil Mitchell
Hi > I think there is a niche for a subset of the hackage libraries providing > an officially sanctioned standard library collection. Currently, > hackage includes, well, everything. As such, it is a useful resource, > but it would be useful to have a partitioning into two levels, where the > "S

Re: [Haskell-cafe] Library Process (was Building "production stable" software in Haskell)

2007-09-18 Thread Neil Mitchell
Hi > What is the process for the inclusion of modules / packages in ghc, hugs and > other compilers & interpreters? Propose to have the packaged added. There is a very low chance of this being accepted. The only packages to have recently been added were FilePath and ByteString, both of which were

Re: [Haskell-cafe] Building "production stable" software in Haskell

2007-09-17 Thread Neil Mitchell
Hi > Competing packages for XML or DBM is really awful, unless they happen > to be interface compatible. Imagine two XML libraries which share the same interface. That implies that they have exactly the same design criteria, take the same view of XML files and are pretty much the same in every us

Re: [Haskell-cafe] Building "production stable" software in Haskell

2007-09-17 Thread Neil Mitchell
Hi > > They are less stable and have less quality control. > > Surely you jest? I see no evidence of this, rather the contrary in fact. No, dead serious. The libraries have a library submission process. Compare me changing my tagsoup library, to me changing my filepath library which comes bundle

Re: [Haskell-cafe] Building "production stable" software in Haskell

2007-09-17 Thread Neil Mitchell
Hi > What's bad about stagnation is that nobody will bother to produce > anything better (at least not as a fully polished publicly available > open source project), precisely because they have little chance of > achieving a user base exceeding 1 (at least not if the attitude of > David and Neil i

Re: [Haskell-cafe] Building "production stable" software in Haskell

2007-09-17 Thread Neil Mitchell
Hi > Would you care to explain why you have this aversion to libs that aren't > bundled with ghc? They are less stable and have less quality control. It is also an additional burden for a user to install the library to get the program working. cabal-install should fix the second. Some useful com

Re: [Haskell-cafe] Re: [Haskell] question about a failure to generalize

2007-09-15 Thread Neil Mitchell
Hi > Monomorphism restriction? Replacing fold with foldRegsUsed would work > because there's a type signature for foldRegsUsed. That looks like it. Another solution would be: > fold = foldRegsUsed becomes: > fold x = foldRegsUsed x Now the monomorphism restriction doesn't kick in because fold

Re: [Haskell-cafe] Re: Is "take" behaving correctly?

2007-09-13 Thread Neil Mitchell
Hi > >From the logical point of view tailMay is the right one. > It pushes the error handling to the caller programm. > > tail = fromJust . tailMay The error messages suffer: tail [] = "error: fromJust Nothing" That's why I supplied tailNote, where tailNote "foo broke its invariant!" [] gives t

Re: [Haskell-cafe] Re: Is "take" behaving correctly?

2007-09-13 Thread Neil Mitchell
Hi > Is there a reason for not having > > tailM :: Monad m => [a] -> m [a] > > which, at least for me, is much more useful? No, that probably is a much more sensible choice. Patches welcome :) Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Re: Is "take" behaving correctly?

2007-09-13 Thread Neil Mitchell
Hi > Similarly, I expect foo and foo' to be equivalent, except for strictness > properties, but perhaps an underscore could be used for slightly > different behaviors (interpretations, as it were)? "tail_" or "zip_", > anyone? There are 4 variants of tail: tail :: [a] -> [a] -- normal tailDef :

Re: [Haskell-cafe] Re: Is "take" behaving correctly?

2007-09-13 Thread Neil Mitchell
Hi > Although I appluad the semantics of the safe package, I'm not delighted > with the idea of replacing our concise elegant standard library names > with uglyAndRatherLongCamelCaseNamesThatCouldBePerlOrEvenJava though. > Conciseness of expression is a virtue. They aren't that long - merely an e

Re: [Haskell-cafe] Re: Is "take" behaving correctly?

2007-09-12 Thread Neil Mitchell
Hi > The same should apply to head and tail. head or tail of [] should be []. > > What does the list think? Disagree, strongly. Its not even possible for head, since [a] -> a. Wadler's theorems for free states that if head is given an empty list the _only_ thing it can do is crash. Thanks Ne

Re: [Haskell-cafe] Re: Is "take" behaving correctly?

2007-09-12 Thread Neil Mitchell
Hi > A more serious point is that in some cases we might want take to > underapproximate, or zip to truncate (or tail [] = [] ?). I don't > think there's > always a clear "library" choice here. I have a zipWithEq function I often use, which crashes if the zip'd lists aren't equal. I also have tai

Re: [Haskell-cafe] haskell and reflection

2007-09-11 Thread Neil Mitchell
Hi > there is no runtime representation of type available for programmatic > representation Data.Typeable.typeOf :: Typeable a => a -> TypeRep > there is no runtime representation of the type-inferencing or checking > machinery Pretty much, no. The GHC API may provide some. > there is no runti

Re: [Haskell-cafe] Building "production stable" software in Haskell

2007-09-11 Thread Neil Mitchell
Hi > Well, I actually meant more something like the imperative equivalences > of "code coverage tools" and "unit testing tools", hpc and HUnit cover these two things pretty perfectly. hpc will be in GHC 6.8, and its really cool :-) > because I've read > rumors that in Haskell, unit testing is mo

Re: [Haskell-cafe] Building "production stable" software in Haskell

2007-09-11 Thread Neil Mitchell
Hi Peter, > The way I see it as a newcomer, Haskell shifts the typical imperical > programming bugs like null pointers and buffer overruns towards > "space/time leaks", causing programs that either take exponentially long > to complete, stack overflow, or fill up the swap file on disc because > th

Re: [Haskell-cafe] Tiny documentation request

2007-09-10 Thread Neil Mitchell
Hi > > I've never really understood what the benefit of this is... I mean, > > Google make "the Google toolbar", but what's the point? Why not just > > click on the Google bookmark and type in your search? What benefits does > > installing a special addon provide? You can setup firefox so in the

Re: [Haskell-cafe] WinHugs shortcut keys

2007-09-10 Thread Neil Mitchell
Hi Peter, > Automatic reloading is of course THE best solution, and that's already > in :-) Maybe it could help new users to display a simple message into > the WinHugs statusbar like "module XXX reloaded after external > modification at HH:MM:SS) or something? But that's really minor. That would

Re: [Haskell-cafe] WinHugs shortcut keys

2007-09-10 Thread Neil Mitchell
Hi Peter, > It does not seem to have shortcut keys for reload, edit, etc... When do you use reload? WinHugs automatically reloads modified files, so I've never felt the need to reload things. Similarly for edit, typing just edit on its own isn't that useful unless you give it a module. However,

Re: [Haskell-cafe] Speed of character reading in Haskell

2007-09-09 Thread Neil Mitchell
Hi > > (Some list operations are too expensive with ByteString but for most > > string processing it's perfectly fine and much faster than String). > > I'm sure it's true, but it's quite irrelevant to my question, which is > "why is using getChar so much slower than using getContents"? Buffering,

Re: [Haskell-cafe] Tiny documentation request

2007-09-09 Thread Neil Mitchell
Hi > I have the following page bookmarked: > > http://haskell.org/ghc/docs/latest/html/libraries/ Just bookmark: http://haskell.org/hoogle It's not perfect, but it probably solves lots of your problems. > A tip is to use Firefox's search as you type feature if you know the > module name. Thi

Re: [Haskell-cafe] Elevator pitch for Haskell.

2007-09-08 Thread Neil Mitchell
Hi >> Data.Binary is the low level frameworks, now people can pick up the rest. >Last time I checked, there's about half a dozen "binary" packages. All >incompatible. All with different design. Seriously not obvious which one >to use... Data.Binary is the answer, http://www.cse.unsw.edu.au/~dons/

Re: [Haskell-cafe] Elevator pitch for Haskell.

2007-09-08 Thread Neil Mitchell
Hi > * Create sophisticated GUIs. Gtk2hs. Could do with a nice wrapper on that, but Conal is doing some interesting stuff, and I've got PropLang on the back burner. People are thinking the right thoughts, it just needs time. > * Read and write standard binary file formats. (Images, compressed >

Re: [Haskell-cafe] Hackage and GHC 6.8

2007-09-08 Thread Neil Mitchell
Hi Neil, > Given that GHC 6.8 is just around the corner and, given how it has > re-organised the libraries so that the dependencies in many (most/all) > the packages in the hackage DB are now not correct. > > Is there a plan of how to get hackage DB up to speed with GHC 6.8 ? I think whatever we

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Neil Mitchell
Hi There are two entirely separate issues in this thread - let's not confuse them. 1) The old HaWiki content is good and unavailable. I want it made available, in whatever form is appropriate. Please :-) 2) Licensing - the old content cannot be dumped onto the new wiki. My personal view is "who

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Neil Mitchell
Hi > Bring back HaWiki! I couldn't agree more! We built up an incredible array of articles, by fantastic authors with stunning content - which we then deleted... I learnt much from the old wiki, and it would be a shame if others didn't get that opportunity. Of course it should be static only, bi

Re: [Haskell-cafe] defining mapPairs function

2007-08-29 Thread Neil Mitchell
Hi > mapPairs :: (a -> a -> a) -> [a] -> [a] > mapPairs f [x] = [x] > mapPairs f [] = [] > mapPairs f (x:xs) = f x (head xs) : mapPairs f (tail xs) It looks like it works, but you can get a better version by changing the last line: mapPairs f (x:y:zs) = ... - left as an exercise, but no need for

Re: [Haskell-cafe] defining mapPairs function

2007-08-29 Thread Neil Mitchell
Hi Alexteslin, > I just came across with this question on the exam and can not think of > implementing it. > > mapPair :: (a -> a -> a) -> [a] -> [a] > > such that mapPairs f [x1, x2, x3, x4...] = [f x1 x2, f x3 x4,...] I would implement this using direct recursion. As a starting point, the stand

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-25 Thread Neil Mitchell
Hi > Another option would be to port the yhi bytecode interpreter to run on > PalmOS. I tried this, but I ran into three problems: > > 1. libgmp dependency This is no longer an issue, we now have a flag to not require libgmp, which makes type Integer = Int > 2. build system requires Python (sc

Re: [Haskell-cafe] Ideas

2007-08-25 Thread Neil Mitchell
Hi > > Flippi (google: Haskell Flippi) > > ...and yet haskell.org uses WikiMedia? (Which is written in something > bizzare like Perl...) Yes, but WikiMedia is a result of years of work, Flippi is a lot less. Wikipedia uses WikiMedia - its a tried and proven solution. > >> - A "graphical programm

Re: [Haskell-cafe] Ideas

2007-08-25 Thread Neil Mitchell
Hi > - Blogging software. (Because there isn't enough of it in the world yet.) Hope (google: Haskell Hope) > - A wiki program. (Ditto.) Flippi (google: Haskell Flippi) > - A general CMS. Hope > - An interactive function plotter. (GNUplot is nice, but it can't plot > recursive functions...)

[Haskell-cafe] Re: [Haskell] Issue about use of WinHugs

2007-08-24 Thread Neil Mitchell
Hi > I'm new to WinHugs, what's wrong with isUpper of my WinHugs? Nothing. The book/tutorial you are going from is out of date. Before using the isUpper/isLower functions you first have to type ":load Char": Hugs> :load Char Hugs> filter isUpper "ABCDEfgh" "ABCDE" The ":load Char" loads the Cha

Re: [Haskell-cafe] Re: Graph reduction [Was: Where is StackOverflow on the Wiki?]

2007-08-23 Thread Neil Mitchell
Hi > > Yeah, the precise details may vary, even :) But for teaching, an > > automatic tool that does graph reduction would be great. I don't mind > > if it's sloppy (directly apply definitions & pattern matching VS > > everything is a lambda abstraction) and only does simply typed lambda > > calcu

Re: [Haskell-cafe] GHC optimisations

2007-08-23 Thread Neil Mitchell
Hi > Its (==) isn't > reflexive (is it transitive? probably, at least if there aren't too many > optimizations, but floating-point transitive equality isn't very useful). It's not even referentially transparent in all cases. a == b may fail while the double's are in the high precision registers,

Re: [Haskell-cafe] help understanding lazy evaluation

2007-08-22 Thread Neil Mitchell
Hi >factors :: Int -> [Int] >factors n = [x | x <- [1..n], n `mod` x == 0] > >prime :: Int -> Bool >prime n = factors n == [1, n] > > My vague intuition said "we either need factors or we don't, we do > because we need to perform the test, so we compute it". That's wrong, > so a po

Re: [Haskell-cafe] GHC optimisations

2007-08-22 Thread Neil Mitchell
Hi > If Num obeys ring axioms, fromInteger is a perfectly fine > ring-homomorphism. (It's also the first or second homomorphism taught.) Does Int obey these axioms? I'm thinking that assuming properties about things such as numbers is very likely to go wrong very quickly. Monads you might be able

Re: [Haskell-cafe] GHC optimisations

2007-08-22 Thread Neil Mitchell
Hi > Other rules that could be interesting are: > > forall a b. fromInteger a + fromInteger b = fromInteger (a + b) > > forall a b. fromInteger a * fromInteger b = fromInteger (a * b) This is wrong, since the class function can do what it wants. Imagine: instance Num String where (+) = (++)

Re: [Haskell-cafe] Re: Newbie question: Where is StackOverflow on the Wiki?

2007-08-21 Thread Neil Mitchell
Hi > > sum (enum 1 10) => > > sum' 0 (enum 1 10) => > > ... > > > > sum' 36 (9 : enum (9+1) 10) => > > (sum' $! (36+9)) (enum (9+1) 10) => > > sum' 45 (enum (9+1) 10) => > > sum' 45 [] => > > 45 > > > > (I need to find some way to au

Re: [Haskell-cafe] Generic data constructor in pattern?

2007-08-21 Thread Neil Mitchell
Hi Peter, > liftV1 f (V x y) = V (f x) (f y) > liftV2 f (V x1 y1) (V x2 y2) = V (f x1 x2) (f y1 y2) > > liftM1 f (M x y) = M (f x) (f y) > liftM2 f (M x1 y1) (M x2 y2) = M (f x1 x2) (f y1 y2) > Both pairs of lift functions have almost identical implementations. Can I

Re: [Haskell-cafe] GHC optimisations

2007-08-21 Thread Neil Mitchell
Hi > Wait, you're saying that ghc can produce "pure" c-code, that doesnt > contain any assembly code, and that runs as fast as ghc code that does > contain assembly? No. It can produce pure C code (unregistered), but to get high performance it processes the output assembly afterwards (registered)

Re: [Haskell-cafe] is there a way to patch the build-depends line of a cabal file without breaking backwards compatibility?

2007-08-20 Thread Neil Mitchell
Hi Distribution/Simple/InstallDirs.hs:267:36: > Not in scope: `dropDrive' > > [EMAIL PROTECTED]:~/installs/cabal-head/cabal>ls -l `which ghc` > lrwxrwxrwx 1 root root 31 2007-08-20 11:08 /usr/local/bin/ghc -> > /usr/local/bin/ghc-6.7.20070816 You'll need to upgrade the filepath library as we

Re: [Haskell-cafe] ghc 6.7 /6.8

2007-08-19 Thread Neil Mitchell
Hi > will 6.7 be released, or will only 6.8 be ? 6.7 is the HEAD branch, 6.8 will be released. > -in that case, does the 6.8 branch means the freeze is on, and what would be > the target for 6.8 ? Q3/2007 ? Q4 ? Soon, in the next month - according to latest targets/estimates. > ( context: I

[Haskell-cafe] Re: List comprehension desugaring

2007-08-19 Thread Neil Mitchell
Hi Sorry for the noise, I've now realised they are a left to right rewrite system, the second rule is required to set up the base case. Thanks Neil On 8/19/07, Neil Mitchell <[EMAIL PROTECTED]> wrote: > Hi, > > The Haskell desugaring for list comprehensions is given in: &g

[Haskell-cafe] List comprehension desugaring

2007-08-19 Thread Neil Mitchell
Hi, The Haskell desugaring for list comprehensions is given in: http://haskell.org/onlinereport/exps.html#list-comprehensions All the rules seem to be left to right rewrites, apart from the second one, which seems to be right to left. Is there some deep reason for this, or is this accidental. T

Re: [Haskell-cafe] Pattern matching articles/explanations

2007-08-16 Thread Neil Mitchell
Hi > So what I noticed that "A Gentle Introduction to Haskell" mentioned > that wild-cards are useful in constructors. For example: > > head (x:_) = x > > So, does that offer any performance benefits over: > > head (x:xs) = x No. They are exactly the same. _ simply means "a new unique name". > O

Re: [Haskell-cafe] ANNOUNCE: Guihaskell and PropLang 0.1

2007-08-15 Thread Neil Mitchell
Hi Dougal, It's cross platform, and will use GHC and Hugs if they are already installed. Thanks Neil On 8/15/07, Dougal Stanton <[EMAIL PROTECTED]> wrote: > On 15/08/07, Asumu Takikawa <[EMAIL PROTECTED]> wrote: > > == GuiHaskell > > > > Guihaskell is a graphical REPL using PropLang, a GUI comb

Re: [Haskell-cafe] Type without a data constructor?

2007-08-06 Thread Neil Mitchell
Hi > I by mistake defined a type which did not specify a data constructor > > So the question is what are types with no constructors good for? A > simple example would be appreciated. They are called phantom types, and can be used for ensuring properties at the type level. I wrote about them in

Re: [Haskell-cafe] Re: Navigating Haddock

2007-08-06 Thread Neil Mitchell
Hi > > a) use hoogle (haskell.org/hoogle). You can use hoogle to find functions by > > types. But I don't > > know haw to create a query such as ... -> Document -> ... > > Hoogle unfortunately doesn't do that very well, although that would be a > great feature. Wait for version 4 :-) - I've adde

Re: [Haskell-cafe] How odd...

2007-08-04 Thread Neil Mitchell
Hi If you just use Catch (http://www-users.cs.york.ac.uk/~ndm/catch/): > > foo x > >| x < 0 = ... > >| x == 0 = ... > >| x > 0 = ... This gives an error. Something identical to this code is in Data.FiniteMap, and indeed, when using floats and NaN's (or just silly Ord classes) you ca

Re: [Haskell-cafe] Re: Re: Re: monad subexpressions

2007-08-03 Thread Neil Mitchell
Hi > > > do case x of > > > [] -> return 1 > > > (y:ys) -> g y >>= \temp -> f temp > > > See the rule about always binding to the previous line of a do block. > > This case then violates that. > > I assumed that the example was equivalent to : > > do case x of > [] -> re

Re: [Haskell-cafe] Re: Re: Re: monad subexpressions

2007-08-03 Thread Neil Mitchell
Hi > if you write : > > let x = (<-a):x > > is it possible that is desugars into : > > temp <-a > let x = temp:x > > that would'nt work ? That would work, since 'a' doesn't refer to 'x'. I can't think of a real example where it becomes an issue, but the scope within 'a' has changed. > Also : > >

Re: [Haskell-cafe] Re: Re: Re: monad subexpressions

2007-08-03 Thread Neil Mitchell
Hi > > let x = 12 > > let x = (<- x) > > Okay, so the desugaring process wouldn't terminate in that case! One > could either: (a) try to retain the equivalence in theory, but make it > illegal to use x in a monadic subexpression when defining x; (b) we > could abandon my claim that they are equiv

Re: [Haskell-cafe] Re: monad subexpressions

2007-08-03 Thread Neil Mitchell
Hi > > do { do { a; b}; c } > > > > is still the same as > > > > do { a; do { b; c } } > > > > yes? no? perhaps? sometimes? how long did it take you? > > I'm not entirely sure I understand the point here. The monad laws are > defined in terms of >>= and return. They have never had anythi

Re: [Haskell-cafe] Re: Re: monad subexpressions

2007-08-03 Thread Neil Mitchell
Hi > > Can you combine let and do? > > > > do let x = (<- a) > >f x > > Right. In effect, as a matter of fact, the notation > > x <- a > > would become equivalent to > > let x = (<- a) Hmm, interesting. Consider: let x = 12 let x = (<- x) Currently, in let x = ... the x is in scope

Re: [Haskell-cafe] Re: monad subexpressions

2007-08-03 Thread Neil Mitchell
ll monadic bindings get floated to the previous line of the innermost do block, in left-to-right order. Monadic expressions in let statements are allowed. Outside a do block, monadic subexpressions are banned. Despite all these complications, it's still a great idea, and would be lovely

Re: [Haskell-cafe] Re: monad subexpressions

2007-08-03 Thread Neil Mitchell
Hi Perhaps we need to cool this thread down a little bit, and refocus. I personally choose never to use ++ as anything but a statement, since my brain works that way. Other people find different things natural, so can pick what they choose. The one thing you can guarantee is that discussing it isn

Re: [Haskell-cafe] positive Int

2007-08-02 Thread Neil Mitchell
Hi > > It will detect that length ys is natural, and will be safe. However, > > if you pass any arbitrary value as the index to !! it will warn of a > > possible pattern match error. > > I hope catch doesn't actually think that's safe, because it's not - set > ys = xs = [1,2,3,4,5], you'll get an

Re: [Haskell-cafe] monad subexpressions

2007-08-02 Thread Neil Mitchell
Hi Chris, > I've heard Simon (Peyton-Jones) twice now mention the desire to be able > to embed a monadic subexpression into a monad. I think this is a fantastic idea, please do so! > $( expr ) -- conflicts with template haskell > ( <- expr ) -- makes sense, and I think it's unambig

Re: [Haskell-cafe] positive Int

2007-08-02 Thread Neil Mitchell
Hi Catch (www.cs.york.ac.uk/~ndm/catch) can infer that certain uses of numbers fit into the {Neg, Zero, One, Pos} abstraction - so for example it can infer that length returns {Zero, One, Pos}, but not Neg. If you then do: xs !! length ys It will detect that length ys is natural, and will be saf

Re: [Haskell-cafe] Perfect example

2007-08-02 Thread Neil Mitchell
Hi I know that Audrey Tang (the Pugs project) has used hamming numbers for this, see http://www.perl.com/lpt/a/959 Thanks Neil On 8/2/07, Jon Harrop <[EMAIL PROTECTED]> wrote: > > Any suggestions for a perfect example that uniquely demonstrates the benefits > of the Haskell language compared to

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] Constraing satisfaction

2007-07-30 Thread Neil Mitchell
Hi > I have a set of problems in the field of constaint satisfaction and > I'm looking for a tool for this. In simplest form, these task are like > Sudoku puzzle solver, school schedule creator, etc. > Prolog language comes to mind at first. Have you seen Eclipse? http://eclipse.crosscoreop.com/

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 ca

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 curiousit

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: 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[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 used

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

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

[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. How

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 r

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 -

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: [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 bar

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 c

[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 invited,

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] 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. Thank

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

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

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

Re: [Haskell-cafe] Elementary question about Type Constraints

2007-07-09 Thread Neil Mitchell
Hi Is there any reason to use [EMAIL PROTECTED] instead of just t? If there is, please tell me! I can't think of any reason at all! I'm pretty sure they desugar to the same thing. Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

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 th

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

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

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