Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-23 Thread Ketil Malde
Simon Peyton-Jones simo...@microsoft.com writes: Personally I think there are strong advantages to .: I'm sorry, but I don't see it. Function composition is one of /the/ most central concepts to functionaly programming. Overloading dot further is a terrible idea. I don't see why using it for

Re: [Haskell-cafe] Re: Status of TypeDirectedNameResolution proposal?

2009-11-24 Thread Ketil Malde
Robert Greayer robgrea...@gmail.com writes: allow local modules. module Foo where module Bar where data Bar = Bar { x :: Int, y :: Int } module Baz where data Baz = Baz { x :: Int, y :: Int } f a b = Bar.x a + Baz.y b Independent of TDNR I would welcome this.

Re: [Haskell-cafe] Re: Status of TypeDirectedNameResolution proposal?

2009-11-24 Thread Ketil Malde
Ben Millwood hask...@benmachine.co.uk writes: E.g. if module Foo.Bar isn't found in Foo/Bar.hs GHC could look in Foo.hs (which would just contain a concatenation of what would currently reside in Foo.hs and Foo/Bar.hs). The obvious question arising here is what if module Foo.Bar *is* found

Re: [Haskell-cafe] Machine Learning Library (SVM)

2009-11-24 Thread Ketil Malde
Hector Guilarte hector...@gmail.com writes: Ketil, has any progress been made on that library? Specially in the SVM part which is what I'm really looking for... No, the SoC ticket was not funded, and I am not aware of any other Haskell implementation of SVMs (and if there is one, I'm sure it

Re: [Haskell-cafe] Show function a - String

2009-11-27 Thread Ketil Malde
Tsunkiet Man temp.t...@gmail.com writes: Context: someFunction :: Integer - String someFunction = show However it asks me how my function can fail? Well I know my function fails by definition when I do not insert an Integer into SomeFunction. Like SomeFunction 2.3425221 The compiler

Re: [Haskell-cafe] Are there standard idioms for lazy, pure error handling?

2009-12-03 Thread Ketil Malde
Duncan Coutts duncan.cou...@googlemail.com writes: [1] http://hackage.haskell.org/package/failable-list Nice. I agree this is needed (or rather, would be nice to standardise). Although I don't care for the cutesy naming suggested in the 'Train' datatype, failable-list could be made more

Re: [Haskell-cafe] Are there standard idioms for lazy, pure error handling?

2009-12-03 Thread Ketil Malde
Malcolm Wallace malcolm.wall...@cs.york.ac.uk writes: Errm, you mean: 4 `Then` 5 `Then` 1 `Then` Finally success! Yes, sorry, and thanks. I guess I should learn to check with ghci before posting... How about this for a nicer syntax? infixr 8 :+ infixr 8 +: data TList a e = a :+

Re: [Haskell-cafe] Is Haskell a Fanatic?

2009-12-03 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: To feed, or not to feed: that is the question: Out, out, brief troll! This is certainly a thread that's full of sound and fury, but (or so I'm afraid) signifying nothing. :-) -k -- If I haven't seen further, it is by standing in the footprints

[Haskell-cafe] Re: [Haskell] Second Call for Copy: Monad.Reader Issue 15

2009-12-04 Thread Ketil Malde
Brent Yorgey byor...@seas.upenn.edu writes: It's not too late to write something for Issue 15 of the Monad.Reader! Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader! One

Re: [Haskell-cafe] Is Haskell a Fanatic?

2009-12-04 Thread Ketil Malde
Simon Peyton-Jones simo...@microsoft.com writes: Respect, guys, please. Yes. Much as I enjoy the mangling of Shakespeare (finally some use out of that Eng.Lit. class all those years ago), I worry that this will finally be the thread that launched a thousand replies and burned the bottomless

Re: [Haskell-cafe] Wikipedia article

2009-12-05 Thread Ketil Malde
Simon Marlow marlo...@gmail.com writes: There's no need to do any page moving or anything; the new version can just be pasted in. Ok, done! http://en.wikipedia.org/wiki/Haskell_%28programming_language%29 After conferring briefly with people on IRC (yeah, on a Saturday morning, who am I

Re: [Haskell-cafe] diff implementation in haskell

2009-12-07 Thread Ketil Malde
Don Stewart d...@galois.com writes: Are there pure haskell implementations of diff and diff3 algorithms? http://hackage.haskell.org/package/Diff Wherein we can read: | This is an implementation of the O(ND) diff algorithm [...]. It is O(mn) | in space. At first I thought 'N' and 'M'

Re: [Haskell-cafe] Hayoo and Hoogle (beginner question)

2009-12-07 Thread Ketil Malde
Lyndon Maydwell maydw...@gmail.com writes: On Mon, Dec 7, 2009 at 2:43 PM, Colin Adams colinpaulad...@googlemail.com wrote: 2009/12/7 drostin77 ml.nwgr...@gmail.com: Hello Hopefully Helpful Haskell Community! (I really wanted that to be alliteration... couldn't come up with an h word

Re: [Haskell-cafe] Zumkeller numbers

2009-12-07 Thread Ketil Malde
Richard O'Keefe o...@cs.otago.ac.nz writes: factors n = [m | m - [1..n], mod n m == 0] -- saves about 10% time, seems to give the same result: factors n = [m | m - [1..n `div` 2], mod n m == 0]++[n] (But checking against primes is even faster, it seems) -k -- If I haven't seen further,

Re: [Haskell-cafe] Lisp like symbols in haskell

2009-12-08 Thread Ketil Malde
Luke Palmer lrpal...@gmail.com writes: data Sym = Sym String Hash fromString :: String - Sym fromString s = Sym s (hash s) instance Eq Sym where Sym _ h == Sym _ h' = h == h' Much as I am uncomfortable with hash-based equality. 1/2^256, despite being very small, is not zero. It is

Re: [Haskell-cafe] ANN: hakyll-0.1

2009-12-08 Thread Ketil Malde
minh thu not...@gmail.com writes: I wonder how APIs are covered. I don't think an API would be covered. The API is the standard way to use something, if copyright licenses cover usage like this, any executable will be a derivative of the operating system and (possibly) the compiler. Why

Re: [Haskell-cafe] Re: ANN: hakyll-0.1

2009-12-08 Thread Ketil Malde
Tom Tobin korp...@korpios.com writes: Your contributions could still be licensed under a different license (e.g. BSD), as long as the licensing doesn't prevent somebody else to pick it up and relicense it under GPL. Right. So hakyll is absolutely fine with a BSD3 license, AFAICS.

Re: [Haskell-cafe] Re: ANN: hakyll-0.1

2009-12-08 Thread Ketil Malde
Tom Tobin korp...@korpios.com writes: 1) Is there any scenario where Y can be distributed under a non-GPL license (e.g., the BSD)? 2) If so, what would Y's author need to do (or *not* do)? 3) If Y must be released under the GPL under the above scenario, and someone subsequently wrote

Re: [Haskell-cafe] Re: ANN: hakyll-0.1

2009-12-09 Thread Ketil Malde
Tom Tobin korp...@korpios.com writes: In temporary lieu of posing questions explicitly to the SFLC, I dug up a copy of _Intellectual Property and Open Source_ by Foobar (and published by O'Reilly), and found this (from an entire chapter — Chapter 12 — about the GPL): Nevertheless, there is

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-10 Thread Ketil Malde
Richard O'Keefe o...@cs.otago.ac.nz writes: You mean to parse a - b differently then a-b? You don't have the problem in LISP as AFAIR you use (- a b) but in Haskell it would be a problem. Haskell already has this problem with ., where we generally need (As somebody pointed out, this is

Re: [Haskell-cafe] Re: Why?

2009-12-10 Thread Ketil Malde
Sebastian Sylvan sebastian.syl...@gmail.com writes: I think laziness requires purity to make sense. Laziness implies that the order of evaluation is highly unpredictable and depends strongly on the implementation details of libraries and such Laziness is like single-threaded concurrency. So

Re: [Haskell-cafe] What about adding a wiki for each haskell project?

2009-12-13 Thread Ketil Malde
wren ng thornton w...@freegeek.org writes: Using a wiki page for each project enables anybody to add comments.[...] I think this is a great idea. Because of Duncan's concerns about imposing too much burden on authors, and because there are many mature projects which already have wikis etc,

Re: [Haskell-cafe] What about adding a wiki for each haskell project?

2009-12-13 Thread Ketil Malde
wren ng thornton w...@freegeek.org writes: Ketil Malde wrote: At least the way I see it, it is primarily *not* for use by the author, and in fact most useful when the author is not around to actively support his project. But if it's a wiki, wouldn't people be able to add changes themselves

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Ketil Malde
Jon Fairbairn jon.fairba...@cl.cam.ac.uk writes: As one of the early Haskellers, I definitely preferred underscores, because my intuition told me that it was closer in appearance to normal English¹ text, [1] and quite a high proportion of other natural languages. Which makes me wonder -

Re: [Haskell-cafe] Double free-ing

2009-12-17 Thread Ketil Malde
Mitar mmi...@gmail.com writes: I checked ByteString's hGetNonBlocking now and I do see why it is still better to use System.IO's hGetBufNonBlocking. [...] But with hGetNonBlocking I would have to append two different buffers to get a resulting buffer, what is completely unnecessary O(n).

Re: [Haskell-cafe] Pattern matching, and bugs

2009-12-18 Thread Ketil Malde
András Mocsáry amo...@gmail.com writes: Now we have a problem, which is most generally fixed in these ways: C-like: switch ( x ) { Case 0: Unchecked Case 1: Checked Case 2: Unknown Default: Nothing } This is not a fix, this is a workaround for a design bug, namely

[Haskell-cafe] profiling problem

2009-12-23 Thread Ketil Malde
Hi, I guess I should report this? Previously, this program got a signal 11, and that happened somewhat later in the process, so I'm not sure how reproducible it is. Source and data is available, if it is of any interest. (This is using the GHC currently shipped with Ubuntu 9.10.) xml2x3prof:

Re: [Haskell-cafe] FGL/Haskell and Hierarchical Clustering/dendograms

2009-12-23 Thread Ketil Malde
Nikolas Borrel-Jensen nikolasbor...@gmail.com writes: I have very hard to see, how this could be done efficiently without pointers (as in C). I have thought of just saving the nodes from the start of the root path, and traversing it, but a lot of searching should be done all the time. I must

[Haskell-cafe] 64-bit Bloom filters?

2010-01-05 Thread Ketil Malde
Hi, I've previously used Bloom filters on 32-bit Linux with some success. However, after upgrading to 64 bit, my Bloom filter applications crash or misbehave in random ways. So: is anybody successfully using Bloom filters on 64 bit computers? Although I'm not clear on why it would cause

Re: [Haskell-cafe] short licensing question

2010-01-11 Thread Ketil Malde
Svein Ove Aas svein@aas.no writes: when writing a Haskell library that uses two other Haskell libraries -- one licensed under BSD3 and one under LGPL -- what are allowed possibilities for licensing the written package? Any resulting binaries might contain a mixture of such libraries, and

Re: [Haskell-cafe] short licensing question

2010-01-12 Thread Ketil Malde
Sebastian Fischer s...@informatik.uni-kiel.de writes: I wonder whether the following statements are valid: You want my layman's opinion? When I write a program that uses an LGPL library, I am allowed to distribute the *sources* of my program under a permissive (non- copyleft) license like

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Ketil Malde
sylvain sylvain.na...@googlemail.com writes: Let me order your list: Smalltalk: 0 Lisp: 0 Tcl: 0 If you count reserved tokens, I guess Lisp reserves parentheses and whitespace? Haskell: 21 * Python: 31 C: 32 * JavaScript: 36 Ruby: 38 --- Borland Turbo Pascal: ~50 Java: 53

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Ketil Malde
Fraser Wilson blancoli...@gmail.com writes: module LordsOfMidnight.Character(Character) where data Character = C { name :: String, location :: (Int,Int), facing :: Direction, hour :: Int, energy

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Ketil Malde
Brandon S. Allbery KF8NH allb...@ece.cmu.edu writes: If we're going to go that far, FORTRAN and PL/1 have none. FORTRAN is somewhat infamous for this: There's also the option (perhaps this was PL/1?) of writing constructs like: IF THEN THEN IF ELSE THEN etc. Having few reserved words isn't

Re: [Haskell-cafe] Typed Configuration Files

2010-01-14 Thread Ketil Malde
Magnus Therning mag...@therning.org writes: Seriously, cmdargs is *brilliant*. It's also magic (to me). On this list, I'm uncertain whether brilliant is a warning or a recommendation, but magic is clearly irresistible, so I had a go at using cmdargs. And I agree, it is really nice in quickly

Re: [Haskell-cafe] wildcards for type variables?

2010-01-14 Thread Ketil Malde
Ozgur Akgun ozgurak...@gmail.com writes: Can someone give an example of a reasonable function that never uses one of its parameters, and justify the existence of that parameter in this case, please? E.g, 'const' is useful when you need something to feed to a higher order function: -- an

Re: [Haskell-cafe] Typed Configuration Files

2010-01-14 Thread Ketil Malde
Ketil Malde ke...@malde.org writes: - CmdArgs helpfully provides default --help, --version as well as --quite and --verbose. For the two former, there's also a nice default implementation, but presumably the latter two are for use in the program proper. Unfortunately, I don't know how

Re: [Haskell-cafe] Typed Configuration Files

2010-01-15 Thread Ketil Malde
Neil Mitchell ndmitch...@gmail.com writes: The CmdArgs manual might help: http://community.haskell.org/~ndm/darcs/cmdargs/cmdargs.htm Yes, this is what I used :-) Presenting examples is great, but gives me the hubris to rip off the example that seems to fit most closely, and modify it. This

Re: [Haskell-cafe] Re: AlternativePrelude extension

2010-01-17 Thread Ketil Malde
Maciej Piechotka uzytkown...@gmail.com writes: However, the option to set language extension globally is still available, either as an option to the compiler when building, or in the cabal file describing the package. Hmm. Since the extensions should be specified in Cabal anyway (at least I

Re: [Haskell-cafe] Having a look at XMonad window manager

2010-01-19 Thread Ketil Malde
michael rice nowg...@yahoo.com writes: Perhaps. Is there a Linux distro that's more XMonad friendly? I use Ubuntu, in the GDM login screen, I get a drop down menu that includes Xmonad as an option. Even if Fedora doesn't have this, it probably has a Failsafe option that will just give you an

Re: [Haskell-cafe] scheduling an alarm

2010-01-28 Thread Ketil Malde
Brian Denheyer bri...@aracnet.com writes: doEvent f usDelay = forkIO $ threadDelay usDelay doEvent f usDelay f There's a missing 'do' here, right? Infinite loop? yes, that is what you wanted. Memory gobbling? Why would you think that? Why would I think that ? doEvent f

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-28 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: It has been known to call such things 'computations', I think actions has been used, too, but perhaps mostly for things in IO and similar monads? as opposed to 'values', and even to separate the categories of types and expressions which

Re: [Haskell-cafe] scheduling an alarm

2010-01-28 Thread Ketil Malde
Thomas DuBuisson thomas.dubuis...@gmail.com writes: Yes - I said that in a later e-mail but it doesn't fix me violating my own peeve about non-functional code snippits on -cafe. I guess we're spoiled by the type checker catching all our mistakes. Since I recently discovered the new and

Re: [Haskell-cafe] Links to darcs.haskel.org in the haskellwiki

2010-02-08 Thread Ketil Malde
Henk-Jan van Tuyl hjgt...@chello.nl writes: There are a lot of links in the haskellwiki that point to projects at darcs.haskel.org; I hope that anyone who moves a project, looks the links up and updates them. An example of a page with several obsolete links is I check my own pages once in a

Re: [Haskell-cafe] Using Cabal during development

2010-02-09 Thread Ketil Malde
Limestraël limestr...@gmail.com writes: how do usually Haskell developpers build their softwares (and especially medium or big libraries) while they are still developping them ? With cabal-install, by doing one 'cabal configure' once and 'cabal build' each time they have altered their code ?

Re: [Haskell-cafe] Seen on reddit: or, foldl and foldr considered slightly harmful

2010-02-11 Thread Ketil Malde
Johann Höchtl johann.hoec...@gmail.com writes: In a presentation of Guy Steele for ICFP 2009 in Edinburgh: http://www.vimeo.com/6624203 he considers foldl and foldr harmful as they hinder parallelism because of Process first element, then the rest Instead he proposes a divide and merge

Re: [Haskell-cafe] Linux ghci vs Windows ghci

2010-02-21 Thread Ketil Malde
Donghee Nah ppk...@gmail.com writes: I feel that ghci code executing speed in guest os is 1.5~2x faster than host os The code: let t n = do {if n `mod` 10 == 0 then print n else return ()} t (n+1) t 1 any clue? Speed of the terminal? Cost of syscalls (user/kernel transitions)? -k

Re: [Haskell-cafe] Function to detect duplicates

2010-02-23 Thread Ketil Malde
Rafael Gustavo da Cunha Pereira Pinto rafaelgcpp.li...@gmail.com writes: First I used: noneRepeated=null.(filter (1)).(map length).group.sort But this seemed very unneficient, so I thought that I could detect the duplicates while sorting, and devised this: [...] 1) Is there any

Re: [Haskell-cafe] Haskell and XML, need some tips from practioners

2010-02-25 Thread Ketil Malde
Gregory Collins g...@gregorycollins.net writes: xml: http://hackage.haskell.org/package/xml hexpat: http://hackage.haskell.org/package/hexpat HXT: http://hackage.haskell.org/package/hxt HaXml: http://hackage.haskell.org/package/HaXml After experimenting with a couple of the above, I ended up

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-26 Thread Ketil Malde
| Am Freitag 26 Februar 2010 00:57:48 schrieb Rafael Gustavo da Cunha Pereira | Pinto: | | There is a single 10 digit number that: | | 1) uses all ten digits [0..9], with no repetitions | 2) the number formed by the first digit (right to left, most | significant) is divisible by one | 3) the

Re: [Haskell-cafe] Re: Function to detect duplicates

2010-02-26 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de skrev: Am Freitag 26 Februar 2010 16:50:42 schrieb Ketil Malde: solutions = [[x1,x2,x3,x4,x5,x6,x7,x8,x9,x10] | x1 - [0..9] First digit can't be 0, so make it [1 .. 9]. Since you use the fact that the last digit must be the 0, pull all

Re: [Haskell-cafe] Prelude.undefined

2010-03-04 Thread Ketil Malde
Ivan Miljenovic ivan.miljeno...@gmail.com writes: GHC.Err.CAFTest: Prelude.undefined Are you matching all patterns? When compiling with -Wall does it make any complaints? How would this help? 'Prelude.undefined' happens because somewhere you're trying to evaluate a value defined with that

Re: [Haskell-cafe] Re: GPL answers from the SFLC

2010-03-07 Thread Ketil Malde
Stefan Monnier monn...@iro.umontreal.ca writes: What if a new library X' released under BSD or MIT license implements the X API (making possible to compile Y against it)? Can such a new library X' be licensed under something else than the GPL (we guess Yes because we don't think it is

Re: [Haskell-cafe] Re: what is inverse of mzero and return?

2005-01-25 Thread Ketil Malde
Daniel Fischer [EMAIL PROTECTED] writes: getChar = 'the action that, when executed, reads a character from stdin and returns it' I still say, getChar is not a well defined value of IO Char. By this line of reasoning, I think any imperative, real-world interacting program is ill-defined.

Re: [Haskell-cafe] using Map rather than FiniteMap

2005-01-25 Thread Ketil Malde
S. Alexander Jacobson [EMAIL PROTECTED] writes: Just did a search after my last post and learned that FiniteMap is bad. Discoverd that Data.Map is the intended replacement. Downloaded it and modified it to work with 6.2. Blazingly fast! Oh? I was aware that Data.Map was supposed to be

Re: [Haskell-cafe] Converting from Int to Double

2005-01-26 Thread Ketil Malde
Dmitri Pissarenko [EMAIL PROTECTED] writes: How can I convert an Int into a Double? You don't convert to, you convert from :-) The function 'fromIntegral' is probably what you want. -kzm -- If I haven't seen further, it is by standing in the footprints of giants

Re: [Haskell-cafe] RE: Answers to Exercises in Craft of FP

2005-01-28 Thread Ketil Malde
Christian Hofer [EMAIL PROTECTED] writes: That is perfectly alright with me. The problem that we are discussing is that it would be helpful to have the solutions to the exercises for a book that I buy for studying on my own. How about: 1) Solve the excercises, and publish the solutions

Re: [Haskell-cafe] Re: mathematical notation and functional programming

2005-01-28 Thread Ketil Malde
Chung-chieh Shan [EMAIL PROTECTED] writes: O(n) which should be O(\n - n) (a remark by Simon Thompson in The Craft of Functional Programming) It's a neat thought, IMHO. I usually try to quantify the variables used, making the equivalent of 'let n = .. in

Re: [Haskell-cafe] Re: ocr'ed version of The implementation offunctional languages

2005-01-31 Thread Ketil Malde
Simon Peyton-Jones [EMAIL PROTECTED] writes: What would OCR buy us? Searching, I guess, which is a fantastic plus. Anything else? - The ability to cut and paste passages into e.g. e-mail. - Availability for text-only access - e.g. for the vision impaired, or people on low bandwidth

Re: [Haskell-cafe] How to debug GHC

2005-04-26 Thread Ketil Malde
Donn Cave [EMAIL PROTECTED] writes: Ideally, I think something like this should be the default behavior for these functions. But something like this should happen for any function, shouldn't it? Any function where pattern match could fail, yes. (Or should that be any partial function?)

Re: [Haskell-cafe] Unexported functions are evil

2005-05-15 Thread Ketil Malde
Peter Simons [EMAIL PROTECTED] writes: The only reason I could think of is that a function is considered to be internal, meaning: You don't want users of the module to rely on the function still being there (or still working the same way) in any of the next revisions. Right. (I guess you

Re: [Haskell-cafe] Text search

2005-05-16 Thread Ketil Malde
Gracjan Polak [EMAIL PROTECTED] writes: find (isSuffixOf needle) (inits haystack) Hmm... While the result isn't exactly the same, I suspect using isPrefixOf and tails would be more efficient. This one is beautiful, but not very practical. Unless you have very repetitive data and/or tiny

Re: [Haskell-cafe] Buddha and GHC 6.4

2005-06-20 Thread Ketil Malde
Gour [EMAIL PROTECTED] writes: This is really a nonsense. The word has lot of meanings. Let them take a look in any Sanskrit dictionary. Hmm.. I must have displaced mine, but are you suggesting Enlightenment (the window manager) could be next? So what will happen in the long term? As yet I

Re: [Haskell-cafe] New-bee question about seq in Parsec.Pos

2005-07-04 Thread Ketil Malde
Christoph Bauer [EMAIL PROTECTED] writes: data SourcePos = SourcePos SourceName !Line !Column deriving (Eq,Ord) My poor haskell knowledge says me, that Line and Column is always strict. Yes. So, what does the following function? forcePos :: SourcePos - SourcePos

[Haskell-cafe] static typing and interactivity

2005-08-18 Thread Ketil Malde
Hi, One slight annoyance using Haskell is the inability to load modules with type problems in the interactive environment (i.e. GHCi). When I have a type error, it would be nice to have an interactive way to explore what the compiler thinks about the types involved -- as it is, I have to resort

Re: [Haskell-cafe] How to use STArray?

2005-08-26 Thread Ketil Malde
Greg Buchholz [EMAIL PROTECTED] writes: Diff arrays have an immutable interface, but rely on internal updates in place to provide fast functional update operator //. While a cool concept, ISTR that somebody benchmarked these some time ago, and found the performance to be fairly poor in

Re: [Haskell-cafe] Re: [Haskell] pros and cons of static typing and side effects ?

2005-08-29 Thread Ketil Malde
Martin Vlk [EMAIL PROTECTED] writes: http://www-i2.informatik.rwth-aachen.de/Staff/Current/michaelw/sttt-ml-haskell.pdf Interesting to see others' experiences, even if they are slightly negative. It contains descriptions of lots of real-world problems and how They are only implementing

Re: [Haskell-cafe] Basic Haskell Types Question

2005-09-16 Thread Ketil Malde
Adam Wyner [EMAIL PROTECTED] writes: I really want to get the following sort of report for the type: negationAtomicProps atomicProps1 :: PropList GHCi seems to get this right. Is that an option for you? -k -- If I haven't seen further, it is by standing in the footprints of giants

Re: [Haskell-cafe] Trapped by the Monads

2005-09-21 Thread Ketil Malde
Bill Wood [EMAIL PROTECTED] writes: The variable mem is a so-called hybrid variable; it crunches together 2 different concepts: a boolean value (could I allocate memory?) and an address value (what is the address where I can find my allocated memory). IMO, Maybe is exactly the oppsite, it

Re: [Haskell-cafe] Basic type classing question.

2005-09-21 Thread Ketil Malde
Karl Grapone [EMAIL PROTECTED] writes: I've just started learning Haskell, and I must admit I'm finding it a bit hard to get my head around the typing system... Okay. What I want to be able to do is add and remove fields while the system is running, While I'm sure you'll get some advanced

Re: [Haskell-cafe] mistake in Gentle Introduction

2005-09-22 Thread Ketil Malde
Michael Vanier [EMAIL PROTECTED] writes: import Prelude hiding length whereas the correct syntax is import Prelude hiding (length) I spent nearly an hour beating my head against this. Can someone fix this in the documentation? Or, alternatively, fix the Haskell syntax? It would be

Re: [Haskell-cafe] Examples of using STUArray + help with converting code

2005-10-14 Thread Ketil Malde
Joel Reymont [EMAIL PROTECTED] writes: If I don't cast then how do I convert this code? Uh, what is wrong with divMod? *Main Data.Word (100::Word64) `divMod` (2^32) (2,1410065408) doubleToInts d = runST ( [...] This will only give you a headache. :-) -k -- If I haven't seen

Re: [Haskell-cafe] Examples of using STUArray + help with converting code

2005-10-14 Thread Ketil Malde
Joel Reymont [EMAIL PROTECTED] writes: I must be missing something because I don't think the code below converts a double. Yes, sorry, my bad. I was (and is) confused about what you wanted to do. -k -- If I haven't seen further, it is by standing in the footprints of giants

Re: [Haskell-cafe] Re: Interest in helping w/ Haskell standard

2005-10-15 Thread Ketil Malde
David Roundy [EMAIL PROTECTED] writes: Bah, simple libraries. They don't have to be part of the Standard Prelude. I completely agree. I'd rather decrease the number of libraries defined in the language itself and decouple library standardization from the definition of the language

Re: [Haskell-cafe] Emptying a list

2005-10-15 Thread Ketil Malde
[EMAIL PROTECTED] writes: Hi there, I'm just wondering if there is a command for emptying a list? Not really. If you want an empty list, you can use []. Also, is there any way to incorporate list operations (concatenation in particular) in a do-statement on lists? Every time I try it gives

Re: [Haskell-cafe] Nice way to calculate character frequency in a string

2005-10-27 Thread Ketil Malde
Udo Stenzel wrote: That raises the question: Should combining functions on containers be provided in a strict variant? Should strict application be the default? With the exception of lists, I generally tend to want strict behavior for collections. Combined with the principle of least

Re: [Haskell-cafe] Nice way to calculate character frequency in a string

2005-10-27 Thread Ketil Malde
Scherrer, Chad wrote: Sorry to drag this thread out, but here's one more thing you might try... (This is the café, isn't it? :-) Another option is perhaps to pack both char and count in one Int and use some kind of Set. This should save some space, and possibly time as well (presuming

Re: [Haskell-cafe] Re: FPS: Finalizers not running (was Memoryusageoutside of the Haskell heap)

2005-11-10 Thread Ketil Malde
Sebastian Sylvan wrote: On 11/8/05, Jan-Willem Maessen [EMAIL PROTECTED] wrote: Just wanted to let people know that I've been working on improving Data.HashTable, with the help of Ketil Malde's badly performing code Always happy to help, of course - bad performance R us:-) Request:

Re: [Haskell-cafe] Re: FPS: Finalizers not running (was Memoryusageoutside of the Haskell heap)

2005-11-12 Thread Ketil Malde
Jan-Willem Maessen wrote: I think that if I can get unsafeFreeze/unsafeThaw to work reliably, it'll finally outperform Data.Map on your example. I haven't yet played with the hash function, which looks kind of bad; there may be hope for improvement there as well. Great! User-level Thaw

Re: [Haskell-cafe] Re: [Haskell] Making Haskell more open

2005-11-14 Thread Ketil Malde
Gour wrote: Nobody said that DocBook does not work fine. However let me quote SPJ's message: quote However, I still wonder if there are things we could do that would make it easier for people to contribute. Here are two concrete suggestions: ^^^ - Make it possible for people to add

Re: [Haskell-cafe] Re: [Haskell] Making Haskell more open

2005-11-14 Thread Ketil Malde
Wolfgang Jeltsch wrote: Hmm, MediaWiki already supports the concept of discussion pages. Yes, I know. Perhaps I was less than lucid, so to clarify: But I doubt that it's a good thing to maintain DocBook sources via a wiki. I think it would be best to keep the documentation in DocBook

Re: [Haskell-cafe] doc/html - wiki - xml

2005-11-16 Thread Ketil Malde
Wolfgang Jeltsch wrote: Oh no! Converting LaTeX to HTML is terrible, in my opinion. One reason for this is that LaTeX isn't a markup language and provides a mixture of logical and visual macros. Conversely, I've occasionally tried to convert stuff - I think a TMR issue was one example,

Re: [Haskell-cafe] Re: layout problem

2005-11-17 Thread Ketil Malde
Benjamin Franksen wrote: If your editor is a little smarter still, it can do the Haskell layout without braces automatically too. The emacs mode helps with this. Yi/hIDE should be able to do it perfectly once it's in a generally usable state. :) Hmm, how would your super intelligent text

Re: [Haskell-cafe] Records

2005-11-18 Thread Ketil Malde
Fraser Wilson [EMAIL PROTECTED] writes: Isn't there a potential for confusion with function composition (f . g)? Perhaps, but I always have spaces on either side when it's function composition. Good for you. Syntax that changes depending on spacing is my number one

Re: [Haskell-cafe] Records

2005-11-19 Thread Ketil Malde
Antti-Juhani Kaijanaho wrote: Ketil Malde wrote: [about A.b and A . b potentially meaning different things:] Syntax that changes depending on spacing is my number one gripe with the Haskell syntax I've generally considered that one of the good ideas in most current languages (it's

Re: [Haskell-cafe] Records

2005-11-21 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: I'm assuming you don't consider the distinction between '::' and ': :' to be a problem - the justification for this is simple and logical: a double colon '::' is a reserved symbol, in the same way that 'then' is a reserved identifier. Intuitively a

Re: [Haskell-cafe] Records

2005-11-22 Thread Ketil Malde
Cale Gibbard [EMAIL PROTECTED] writes: This really isn't so bad in practice though. I've certainly never been confused by it. Well, what can I say? Good for you? You'd have to go out of your way to construct a situation in which it's potentially confusing No. There are much more

Re: [Haskell-cafe] returning lists

2005-12-01 Thread Ketil Malde
raptor [EMAIL PROTECTED] writes: split _ [] = [] split char (x:xs) | x /= char = x : split char xs | otherwise = [] *Main split 'x' str testing I want : [testing,split,...] How do i do this. Collect the read chars in a temp, when the separator is detected, return the

Re: [Haskell-cafe] Learning Haskell

2005-12-07 Thread Ketil Malde
Jimmie Houchin [EMAIL PROTECTED] writes: I have been perusing the haskell.org site and reading some of the tutorials. I just didn't want to expend lots of time just to find out that my math skills were woefully inadequate. I am grateful to learn that I can continue pursuing Haskell. Lots of

Re: [Haskell-cafe] module names

2005-12-15 Thread Ketil Malde
Scherrer, Chad [EMAIL PROTECTED] writes: module Main where module A where module B where in a single file. This example is straight from chapter 5 of the Report, and no mention is made (that I could find) about modules needing to be in separate files. But this won't load in ghci!

Re: [Haskell-cafe] Optimizing a high-traffic network architecture

2005-12-15 Thread Ketil Malde
Einar Karttunen ekarttun@cs.helsinki.fi writes: To matters nontrivial all the *nix variants use a different more efficient replacement for poll. Solaris has /dev/poll *BSD (and OS X) has kqueue Linux has epoll Since this is 'cafe, here's a page has some performance testing of epoll:

Re: [Haskell-cafe] +RTS -M800M

2005-12-17 Thread Ketil Malde
Simon Marlow [EMAIL PROTECTED] writes: On 16 December 2005 10:05, Joel Reymont wrote: I'm trying to restrict GHC to 800Mb of heap at runtime by passing in +RTS -M800M, the machine has 1Gb of memory and top shows free physical memory dropping below 175Mb. -M800m should do more or less the

Re: [Haskell-cafe] Re: Tutorial uploaded

2005-12-21 Thread Ketil Malde
Neil Mitchell [EMAIL PROTECTED] writes: I would have actually said Hugs, and especially the Windows front end WinHugs was a lot more suitable for beginners than GHC, but the wiki page very much gives the other impression. Which page are you referring to? I went to look, but couldn't find any

Re: [Haskell-cafe] Tutorial uploaded

2005-12-21 Thread Ketil Malde
Paul Moore [EMAIL PROTECTED] writes: One thing I'd consider adding is something along the lines of a section: == So how do I write Hello, world? == I've gone and done it. I've perhaps been heavy handed on the original page, so feel free to complain and/or fix it. -k -- If I haven't seen

Re: [Haskell-cafe] Re: When to teach IO

2005-12-22 Thread Ketil Malde
Bayley, Alistair [EMAIL PROTECTED] writes: Hear, hear. Compilers, and computationally complex programs in general, are atypical. IMO, a lot of programming these days is integration work i.e. shuffling and transforming data from one system to another, or transforming data for reports, etc. Not

Re: [Haskell-cafe] Project postmortem II /Haskell vs. Erlang/

2006-01-04 Thread Ketil Malde
Dylan Thurston [EMAIL PROTECTED] writes: http://wagerlabs.com/articles/2006/01/01/haskell-vs-erlang-reloaded | Compare Erlang | | -record(pot, { | profit = 0, | amounts = [] |}). [...] complain about having to explain to the customer how xyFoo is really different from

Re: [Haskell-cafe] data vs type

2006-01-04 Thread Ketil Malde
Daniel Carrera [EMAIL PROTECTED] writes: I'm trying to figure out how 'data' and 'type'. How data and type...what? :-) Generally, 'type' introduces type synonyms, i.e. just gives a new name to an existing type, while 'data' defines new (algebraic) types. So you can use type Name = String

Re: [Haskell-cafe] Shootout rankings

2006-01-15 Thread Ketil Malde
[EMAIL PROTECTED] (Donald Bruce Stewart) writes: :D Haskell now ranked 2nd overall, only a point or so behind C: http://shootout.alioth.debian.org/gp4/benchmark.php?test=alllang=all Very impressive! And note that if you put zero weight on memory use, GHC wins by a large margin. (OTOH,

Re: [Haskell-cafe] Re: Hashtable woes

2006-02-10 Thread Ketil Malde
indicates that it triggers a bug in 6.4.1 Ah, I missed that. For my word counting indexes, I've settled on Data.Map, calculating an Int or Integer hash for each word (depending on word length, which is fixed). I haven't given it nearly the effort the shootout programs have seen, though, so

Re: [Haskell-cafe] Haskell not usally faster

2006-02-10 Thread Ketil Malde
Chris Kuklewicz [EMAIL PROTECTED] writes: Comparing Haskell to OCaml, Haskell is almost always slower. ...but generally not by much. And for another perspective on speed: Haskell loses tremendously in the knucleotide benchmark. As I mentioned previously, even TCL beats us by a margin of two,

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