Re: [Haskell-cafe] type class question

2007-05-22 Thread Stefan Holdermans
Tim, If I have a type class for conversion to a type X: class XType a where toX :: a - X [...] instance XType String where toX = ... results in: Illegal instance declaration for `XType String' (The instance type must be of form (T a b c) where T is

Re: [Haskell-cafe] Editor OT: streamofconciousness

2007-05-22 Thread Jules Bean
John Meacham wrote: It is somewhat depressing that immutable pre-packaged macros[1] and the simple brute-force inclusion of separate tools[2] into the editor are hailed as innovation, when new innovations, whether they are simple refinements of old ideas[3], excercises in orthoginality[4], or

Re: [Haskell-cafe] List algorithm

2007-05-22 Thread Matthew Brecknell
Mark T.B. Carroll: algMemo n m = last memo where memo = [[]] : map helper [1 .. m] helper m' = [ x : xs | x - [1 .. min m' n], xs - memo !! (m' - x) ] This made me wonder whether it's safe to access an array while it's still under construction: import Data.Array.IArray

Re: [Haskell-cafe] List algorithm

2007-05-22 Thread Jules Bean
Matthew Brecknell wrote: This seems to work, but presumably only because it's a boxed array, and the construction makes no circular references. Yes, AIUI the boxed arrays are strict in indices but lazy in values. Therefore they can be used for this kind of memoization trick as long as

Re: [Haskell-cafe] Scope of type variables in associated types

2007-05-22 Thread Bertram Felgenhauer
Matthew Brecknell wrote: Bertram Felgenhauer: How does class F a where data B a :: * data E a :: * wrap :: B a - E a unwrap :: E a - B a sound? 'B a' would represent the 'b' in your previous attempt, class F a b | a - b where ... I'm

Re: [Haskell-cafe] Editor

2007-05-22 Thread Paul Drummond
On 5/21/07, Michael T. Richter [EMAIL PROTECTED] wrote: Code like makeRandomValueST :: StdGen - (MyType, StdGen) (which, incidentally, was far easier to copy from in Gedit than GVim to paste into this message) ... Really? To copy that line of code in vim you could do: v%y assuming the

[Haskell-cafe] Re: Editor

2007-05-22 Thread apfelmus
Jules Bean wrote: Michael T. Richter wrote: 1. A real GUI environment that takes into account some of the HID advances made in the past 30 years. (Emacs and Vim don't count, in other words.) Both emacs and vim take into account many of the HID advances made in the past 30

Re: [Haskell-cafe] List algorithm

2007-05-22 Thread Steffen Mazanek
Thank you for your responses. My algorithm that needs the described function performs so horribily bad that I understand now the need for CNF :-) The idea was to write a CYK-style parser for an arbitrary context-free grammar without transformation to CNF. To compute derivations for a span of

[Haskell-cafe] Inaugural London HUG meeting; attendee list suggestion

2007-05-22 Thread Bayley, Alistair
Tomorrow evening's London Haskell User Group meeting has a reasonable list of attendees (inferred from the comments): http://www.londonhug.net/2007/04/26/announcement-first-meeting-of-the-lo ndon-haskell-user-group/ I think it'd be a good idea to do what the BCS-SPA does, and maintain a

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Jules Bean
apfelmus wrote: I can't know whether that's the case, but the fact that virtually all commands are invoked with the keyboard clashes with HID research reported at http://www.asktog.com/TOI/toi06KeyboardVMouse1.html It adresses the question whether selecting commands in menus with the mouse

[Haskell-cafe] RE: [Haskell] Inaugural London HUG meeting; attendee list suggestion

2007-05-22 Thread Bayley, Alistair
[this time to the list :-] Should we start something here, perhaps? http://www.haskell.org/haskellwiki/London_Haskell_User_Group/Events/2007 0426 Sounds a plausible idea, but shouldn't it be 20070523? Jeremy Yeah... sorry, I totally fished that date out of a body cavity. I think it

[Haskell-cafe] Re: Editor

2007-05-22 Thread apfelmus
Jules Bean wrote: apfelmus wrote: I can't know whether that's the case, but the fact that virtually all commands are invoked with the keyboard clashes with HID research reported at http://www.asktog.com/TOI/toi06KeyboardVMouse1.html It adresses the question whether selecting commands in

Re: [Haskell-cafe] Scope of type variables in associated types

2007-05-22 Thread Matthew Sackman
Matthew Brecknell [EMAIL PROTECTED] wrote: Bertram Felgenhauer: How does class F a where data B a :: * data E a :: * wrap :: B a - E a unwrap :: E a - B a For any given call to wrap or unwrap, how is the compiler supposed to determine which instance

RE: [Haskell-cafe] Re: Editor

2007-05-22 Thread Bayley, Alistair
I'm sure that I can quite reliably hit the command editor keybindings I use many, many times faster than if I had to select them from a menu. Note that the claimed time-consuming part is not to actually press the keybinding, but to chose and remember which one to press. Yes... except

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Donald Bruce Stewart
Alistair_Bayley: I'm sure that I can quite reliably hit the command editor keybindings I use many, many times faster than if I had to select them from a menu. Note that the claimed time-consuming part is not to actually press the keybinding, but to chose and remember which one

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Michael T. Richter
On Tue, 2007-22-05 at 10:19 +0200, apfelmus wrote: I can't know whether that's the case, but the fact that virtually all commands are invoked with the keyboard clashes with HID research reported at http://www.asktog.com/TOI/toi06KeyboardVMouse1.html It adresses the question whether

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Jules Bean
Michael T. Richter wrote: On Tue, 2007-22-05 at 10:19 +0200, apfelmus wrote: I can't know whether that's the case, but the fact that virtually all commands are invoked with the keyboard clashes with HID research reported at http://www.asktog.com/TOI/toi06KeyboardVMouse1.html It adresses

Re: [Haskell-cafe] List algorithm

2007-05-22 Thread Henning Thielemann
On Mon, 21 May 2007, Steffen Mazanek wrote: is there an efficient algorithm that takes two positive numbers n and m and that computes all lists l of numbers 0x=n such that sum l = m? For instance alg 5 1 = [[1]] alg 5 2 = [[1,1],[2]] alg 5 3 = [[1,1,1],[1,2],[2,1],[3]] ...

Re: [Haskell-cafe] List algorithm

2007-05-22 Thread Henning Thielemann
On Mon, 21 May 2007, Mark T.B. Carroll wrote: Steffen Mazanek [EMAIL PROTECTED] writes: alg 5 1 = [[1]] alg 5 2 = [[1,1],[2]] alg 5 3 = [[1,1,1],[1,2],[2,1],[3]] Would this be better? alg n m = case signum m of -1 - [] 0 - [[]] 1 - [ x : xs | x - [1..n], xs

Re: [Haskell-cafe] efficient and/or lazy partitions of a multiset

2007-05-22 Thread Henning Thielemann
On Mon, 21 May 2007, Greg Meredith wrote: HC-er's, Find below some simple-minded code from a naive Haskeller for generating all partitions of a multiset about which i have two questions. mSplit :: [a] - [([a], [a])] mSplit [x] = [([x],[])] What about [] ? See

Re: [Haskell-cafe] type class question

2007-05-22 Thread Henning Thielemann
On Tue, 22 May 2007, Tim Docker wrote: I think this must almost be a FAQ, or at least a PAQ (Previously AQ)... I think it too, thus I added your case to the Wiki: http://www.haskell.org/haskellwiki/List_instance ___ Haskell-Cafe mailing list

[Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Vincent Kraeutler
as was pointed out on the programming reddit [1], crawling of the haskell wiki is forbidden, since http://www.haskell.org/robots.txt contains User-agent: * Disallow: /haskellwiki/ and indeed, a google search gives the old wiki http://www.google.ch/search?q=haskell+wiki i.e.

Re: [Haskell-cafe] List algorithm

2007-05-22 Thread Mark T.B. Carroll
Matthew Brecknell [EMAIL PROTECTED] writes: (snip) This seems to work, but presumably only because it's a boxed array, and the construction makes no circular references. Yes. (-: However, I'm doubtful that memoisation is really beneficial in this function. I think it only gains a

Re: [Haskell-cafe] Ann: Emping 0.2

2007-05-22 Thread Hans van Thiel
On Mon, 2007-05-21 at 14:06 -0700, Scott Cruzen wrote: Is Emping an implementation of C4.5 or something new? No, it's new. The reduction algorithm is not based on a measure and is not a search either. It's a construction of predicate combinations, starting with singletons, that are not

Re: [Haskell-cafe] List algorithm

2007-05-22 Thread haskell
Matthew Brecknell wrote: Mark T.B. Carroll: algMemo n m = last memo where memo = [[]] : map helper [1 .. m] helper m' = [ x : xs | x - [1 .. min m' n], xs - memo !! (m' - x) ] This made me wonder whether it's safe to access an array while it's still under construction:

Re: [Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Henning Thielemann
On Tue, 22 May 2007, Vincent Kraeutler wrote: as was pointed out on the programming reddit [1], crawling of the haskell wiki is forbidden, since http://www.haskell.org/robots.txt contains User-agent: * Disallow: /haskellwiki/ and indeed, a google search gives the old wiki

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Malcolm Wallace
* Test subjects consistently report that keyboarding is faster than mousing. * The stopwatch consistently proves mousing is faster than keyboarding. Even if it is empirically true that mousing is wall-clock faster than keyboarding, one has to ask the question why users feel

[Haskell-cafe] Re: List algorithm

2007-05-22 Thread Christian Maeder
Henning Thielemann schrieb: On Mon, 21 May 2007, Steffen Mazanek wrote: is there an efficient algorithm that takes two positive numbers n and m and that computes all lists l of numbers 0x=n such that sum l = m? For instance alg 5 1 = [[1]] alg 5 2 = [[1,1],[2]] alg 5 3 =

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Michael T. Richter
On Tue, 2007-22-05 at 13:48 +0100, Malcolm Wallace wrote: * Test subjects consistently report that keyboarding is faster than mousing. * The stopwatch consistently proves mousing is faster than keyboarding. Even if it is empirically true that mousing is wall-clock faster

Re: [Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Claus Reinke
as was pointed out on the programming reddit [1], crawling of the haskell wiki is forbidden, since http://www.haskell.org/robots.txt contains User-agent: * Disallow: /haskellwiki/ i agree that having the wiki searchable would be preferred, but was told that there were performance issues. even

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Ketil Malde
On Tue, 2007-05-22 at 10:19 +0200, apfelmus wrote: http://www.asktog.com/TOI/toi06KeyboardVMouse1.html It adresses the question whether selecting commands in menus with the mouse or accessing them via keyboard shortcuts is faster. The answer is: * Test subjects consistently report that

Re: [Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Duncan Coutts
On Tue, 2007-05-22 at 14:40 +0100, Claus Reinke wrote: so the situation for mailing lists and online docs seems to have improved, but there is still the wiki indexing/rogue bot issue, and lots of fine tuning (together with watching the logs to spot any issues arising out of relaxing those

Re: [Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Henning Thielemann
On Tue, 22 May 2007, Duncan Coutts wrote: So if we can ban bots from the page histories or turn them off for the bot user agents or something then we might have a cure. Perhaps we just need to upgrade our media wiki software or find out how other sites using this software deal with the same

Re: [Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Duncan Coutts
On Tue, 2007-05-22 at 16:26 +0200, Henning Thielemann wrote: On Tue, 22 May 2007, Duncan Coutts wrote: So if we can ban bots from the page histories or turn them off for the bot user agents or something then we might have a cure. Perhaps we just need to upgrade our media wiki software or

RE: [Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Bayley, Alistair
So if we can ban bots from the page histories or turn them off for the bot user agents or something then we might have a cure. Perhaps we just need to upgrade our media wiki software or find out how other sites using this software deal with the same issue of bots reading page

Re: [Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Robin Green
On Tue, 22 May 2007 15:05:48 +0100 Duncan Coutts [EMAIL PROTECTED] wrote: On Tue, 2007-05-22 at 14:40 +0100, Claus Reinke wrote: so the situation for mailing lists and online docs seems to have improved, but there is still the wiki indexing/rogue bot issue, and lots of fine tuning

Re: [Haskell-cafe] haskell wiki indexing

2007-05-22 Thread Claus Reinke
The wiki could be configured to use /haskellwiki/index.php?.. urls for diffs (I believe this can be done by changing $wgScript). Then robots.txt could be changed to Disallow: /haskellwiki/index.php Which bans robots from everything except normal pages. that sounds like the most promising

Re: [Haskell-cafe] How do I insert an element in HaXml?

2007-05-22 Thread Malcolm Wallace
Jeremy Shaw [EMAIL PROTECTED] wrote: Another example is sorting the children. sortedChildren match = mkElem match [ sortBy ((=) `on` tagName) . children ] `o` tag match where tagName (CElem (Elem name _ _ _)) = name or maybe, to use the labelling combinators rather than

[Haskell-cafe] Re: efficient and/or lazy partitions of a multiset

2007-05-22 Thread Greg Meredith
Henning, In your reply, you made a number of interesting suggestions. You could also have written mSplitC :: [a] - [([a], [a])] -- C for comprehension mSplitC [] = [([],[])] mSplitC [x] = [([x],[])] mSplitC (x:xs) = concat [ [(x:l,r),(l,x:r)] | (l,r) - mSplitC xs ] which Matthias Radestock

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Albert Y. C. Lai
This recent development of the thread leads me to these conclusions and conjectures. * If you want to demonstrate the mouse to be faster than the keyboard, you can contrive an experiment to do so. Example: Randomize occurences of X's in a text, ask to replace them by Y's, but make sure there

Re: [Haskell-cafe] Editor OT: streamofconciousness

2007-05-22 Thread Chaddaï Fouché
While I strongly disagree with you on the fact that refactoring is just big macros (well it is, simply they're macros which operate more on structured code than on structured text, ie they're aware of the semantic of the language on which they're operating, and I don't know you but I don't code

Re: [Haskell-cafe] global variables

2007-05-22 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Isaac Dupree wrote: Maybe some sort of ISOLATE, DON'T_OPTIMIZE (but CAF), or USED_AS_GLOBAL_VARIABLE pragma instead of just the insufficient NOINLINE would be a good first step... if successful it would remove the occasional need for -fno-cse for

[Haskell-cafe] Re: Editor

2007-05-22 Thread Ashley Yakeley
Michael T. Richter wrote: I have a dream. It's not a little dream. It's a big dream. I have a dream that someday I can find a UNIX/Linux text editor for Haskell hacking (and possibly two or three hundred other programming languages, although that's optional) that can give me all of the

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Gabor Greif
Am 23.05.2007 um 00:20 schrieb Ashley Yakeley: I don't suppose you're familiar with the Dylan programming language, or more to the point, have looked at the IDE that Apple included in their original implementation of the language (around 1993 or so)? Characteristic of Apple of that time,

Re: [Haskell-cafe] Re: Editor (OT: keyboard mouse / one device + my 2 cents)

2007-05-22 Thread Marc Weber
I did think about this topic many times. My conclusion: We need some other kind of interface (keyboard and mouse at the same time which would speed up your workflow very often, especially when doing some kind of graphics where you have to enter some text).. One solution I did find is

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

2007-05-22 Thread Jacques Carette
Personally I would like {-# OPTIONS -fglasgow-exts -fgenerics -} module Blog.Types where family Usual = (Eq, Ord, Read, Show, Typeable) data BlogEntry = Entry EpochSeconds Name Email Title Body deriving Usual newtype Name = Name String deriving Usual newtype Title = Title String deriving

RE: [Haskell-cafe] type class question

2007-05-22 Thread Tim Docker
Thanks for this - I only wonder if the page title List Instance would have suggested that this was a solution to me problem - I can't think of a better name however: Lists as type class instances perhaps? -Original Message- From: Henning Thielemann [mailto:[EMAIL PROTECTED] Sent:

[Haskell-cafe] Currying: The Rationale

2007-05-22 Thread PR Stanley
Hi What is the rationale behind currying? is it for breaking subroutines into pure one-to-one mappings? If f x y = f x - a function which takes y for argument then does that mean that the second function already has value x, as it were, built into it? The syntax in Haskell is perfectly lucid

Re: [Haskell-cafe] Currying: The Rationale

2007-05-22 Thread Philippa Cowderoy
On Wed, 23 May 2007, PR Stanley wrote: Hi What is the rationale behind currying? is it for breaking subroutines into pure one-to-one mappings? We don't have 'subroutines' as such, but otherwise yes. Also, it gives us partial application - we don't have to apply all the parameters at once,

Re: [Haskell-cafe] Currying: The Rationale

2007-05-22 Thread PR Stanley
Hi What is the rationale behind currying? is it for breaking subroutines into pure one-to-one mappings? We don't have 'subroutines' as such, but otherwise yes. Also, it gives us partial application - we don't have to apply all the parameters at once, and we can do interesting and useful

Re: [Haskell-cafe] Currying: The Rationale

2007-05-22 Thread Brandon S. Allbery KF8NH
On May 22, 2007, at 22:35 , PR Stanley wrote: Could you perhaps demonstrate how you can apply parts of curried functions in other functions in Haskell? A trivial example: Prelude map (+1) [1..10] [2,3,4,5,6,7,8,9,10,11] (Strictly speaking (+1) is a section, but that's just a syntactic

Re: [Haskell-cafe] Currying: The Rationale

2007-05-22 Thread Donald Bruce Stewart
prstanley: Hi What is the rationale behind currying? is it for breaking subroutines into pure one-to-one mappings? We don't have 'subroutines' as such, but otherwise yes. Also, it gives us partial application - we don't have to apply all the parameters at once, and we can do

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread brad clawsie
it should also be noted that there are rsi issues with switching constantly between mouse and keyboard. moving to an environment that focuses on textual input (mutt+emacs+elinks on top of screen on top of xmonad) has allowed me to keep my hands in the ergonomic position dictated by my keyboard.