Re: [Haskell-cafe] Yet another top-level state proposal

2007-05-29 Thread Claus Reinke
At the risk of becoming repetitious, let's keep refining the Wiki to give these competing proposals in their most up-to-date form. I'm not arguing against email -- it's an excellent medium for discussion -- but having the outcomes recorded makes them accessible to a much wider audience who

Re: [Haskell-cafe] shared oneShot IO (was top-level state proposals)

2007-05-29 Thread Claus Reinke
I was wondering why, since IO is an instance of MonadFix [1], and therefore of ArrowLoop (Kleisli m), and since The loop operator expresses computations in which an output value is fed back as input, even though the computation occurs only once. [2], the MonadFix or ArrowLoop class (through

Re: [Haskell-cafe] Language extensions

2007-05-28 Thread Claus Reinke
I meant to imply more that it's very difficult to understand why it's useful. If an extension were truely *useless*, I doubt those guys at GHC would have bothered spending years implementing them. Most of the documents that describe these things begin with suppose we have this extremely

Re: [Haskell-cafe] Language extensions [was: Memoization]

2007-05-28 Thread Claus Reinke
I'm thinking more about things like phantom types, rank-N polymorphism, functional dependencies, GADTs, etc etc etc that nobody actually understands. this seems to be overly polymorphic in generalising over all types of Haskell programmers, rather than admitting the existence of some types

[Haskell-cafe] shared oneShot IO (was top-level state proposals)

2007-05-26 Thread Claus Reinke
i thought the discussion had actually progressed a little further than might be obvious from http://www.haskell.org/haskellwiki/Top_level_mutable_state here is my summary of what i thought was the state of the discussion, followed by a hopefully simpler proposal. first, i'd like to

Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Claus Reinke
Oh, but there is the *minor* detail that I am literally allowing unauthenticated users to perform arbitrary code execution. For example, .. AFAIK, Lambdabot dissalows any expression that performs IO. In Haskell, this is beautifully easy: reject any expression having an IO type. .. Don't use

Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Claus Reinke
The #haskell people have been working on this for about 3 years now. The result is the 'runplugs' program, which I've talked about in previous mails. http://www.cse.unsw.edu.au/~dons/code/lambdabot/scripts/RunPlugs.hs It uses hs-plugins for the evaluation, along with the points about IO

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

2007-05-24 Thread Claus Reinke
| according to the most recent status report, the syntax is not quite | settled yet, so what is in ghc head might still change. more info here: | | http://haskell.org/haskellwiki/GHC/StandAloneDeriving Indeed... but nothing much is happening at the moment because there's not been much

Re: [Haskell-cafe] Should do 1 compile

2007-05-23 Thread Claus Reinke
foo = do (1 :: Int) While intuitively this should be disallowed, it seems a pity that desugaring couldn't be totally separated from typechecking. Hmm. or perhaps not. while a type-free desugaring, followed by type-checking, seems more modular, i'd rather see any type errors in terms of the

Re: [Haskell-cafe] Should do 1 compile

2007-05-23 Thread Claus Reinke
if you want to go down that route: Prelude let monadic m = m `asTypeOf` return undefined Prelude :t monadic undefined monadic undefined :: (Monad m) = m a Prelude :t monadic $ undefined return () monadic $ undefined return () :: (Monad m) = m () Prelude :t monadic $

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

2007-05-21 Thread Claus Reinke
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 following: 'find / -type dream

Re: [Haskell-cafe] Disadvantages of de Bruijn indicies?

2007-05-14 Thread Claus Reinke
Anyway, Conor and James' Haskell Workshop paper on manipulating syntax that involves both free and bound variables [1] is really nice and could perhaps be of interest to you. If I remember correctly this paper is not about a pure de Bruijn index representation, but about a mix between names and

Re: [Haskell-cafe] Re: Compilling GHC on Vista

2007-05-13 Thread Claus Reinke
I've solved the problem by adding the correct paths to the system's PATH variable. I don't know why, but it seems that just putting SET PATH=... in cygwin.bat doesn't work... cygwin.bat is read before bash is started; bash later reads profile and bashrc files that tend to redefine PATH. for

Re: [Haskell-cafe] Disadvantages of de Bruijn indicies?

2007-05-11 Thread Claus Reinke
de Bruijn indicies look quite nice, and seem to eliminate a lot of complexity when dealing with free variables: http://en.wikipedia.org/wiki/De_Bruijn_index the complexity is not really eliminated, but made precise and mechanised, which is helpful for tools, less helpful for humans. From what

Re: [Haskell-cafe] ANN: FileManip 0.1, an expressive file manipulationlibrary

2007-05-02 Thread Claus Reinke
The FileManip package provides expressive functions and combinators for searching, matching, and manipulating files. hi Brian, i'm a fan of find | xargs, so a portable haskell replacement unencumbered by viral licenses would be very welcome. i have no intention to participate in

Re: [Haskell-cafe] ANN: FileManip 0.1, an expressive filemanipulationlibrary

2007-05-02 Thread Claus Reinke
i'm a fan of find | xargs, so a portable haskell replacement unencumbered by viral licenses would be very welcome. i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended?

Re: [Haskell-cafe] ANN: FileManip 0.1, an expressive file manipulationlibrary

2007-05-02 Thread Claus Reinke
i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended? I didn't use the LGPL by accident. However, I might be amenable to persuasion, perhaps more so if you climb down from that

Re: [Haskell-cafe] Displaying infered type signature of 'offside'functions

2007-04-29 Thread Claus Reinke
On 28/04/07, Georg Sauthoff [EMAIL PROTECTED] wrote: Well, I mention this, because I would like to integrate some lookup feature (for type signatures) into vim (if it doesn't exist yet). It's worth pointing out that Emacs's haskell-mode already has this. as do many Vim Haskell modes. for

Re: [Haskell-cafe] Re: Compilling GHC on Vista

2007-04-28 Thread Claus Reinke
that certainly looks somewhat confused. and the '/mingw/lib/crt2.o' at the start of that ld call is going to be the first stumbling point. in any case, that test result clearly puts the issue in gcc territory, i think. with your PATH settings, i don't even see how you could be picking up the

Re: [Haskell-cafe] Re: Compilling GHC on Vista

2007-04-28 Thread Claus Reinke
pps. ah, silly me. i finally understand that ghc ticket #1280 is not a ghc issue at all. if gcc depends on that same call, it will not see the mingw ld as executable, so might fall back on defaults later in the PATH, right? but that would make me wonder how anyone could have a vista

Re: [Haskell-cafe] Displaying infered type signature of 'offside'functions

2007-04-28 Thread Claus Reinke
Thus I searched for a way to get this information for functions, which are defined offside (of the main indentation level). So, what tools do you use to get the inferred type signature of local functions? i tend to do that by hand: if i write f .. = e where ..defs.. as f .. =

Re: [Haskell-cafe] Re: Compilling GHC on Vista

2007-04-26 Thread Claus Reinke
I suspect this may be because gcc has managed to pick up the Cygwin ld instead of the mingw one. Monique - what exactly is your PATH? What happens when you say 'ld --version'? 'ld --version' doesn't show differences between mingw/cygwin, does it? and even the mingw ld apparently sets its

Re: [Haskell-cafe] Re: Compilling GHC on Vista

2007-04-26 Thread Claus Reinke
and even the mingw ld apparently sets its search_dirs without drive letters: that shouldn't be the problem, though, as the failing part of ./configure was an indirect call via gcc, which seems to set the library prefixes correctly, when calling collect2 (see below). it was just that the error

Re: [Haskell-cafe] Is Excel a FP language?

2007-04-25 Thread Claus Reinke
My opposition proposed (after some weeding out) that there is a distinction between Excel, the application, the GUI and Excel, the language (which we eventually agreed (I think) manifested itself as a .xls file). Similarly, VB is both a language and a development environment and referring to VB

Re: [Haskell-cafe] Re: Compilling GHC on Vista

2007-04-25 Thread Claus Reinke
gcc version 3.4.2 (mingw-special) configure:3288: $? = 0 configure:3295: c:/MinGW/bin/gcc -V 5 gcc.exe: `-V' option must have argument configure:3298: $? = 1 configure:3321: checking for C compiler default output file name configure:3348: c:/MinGW/bin/gccconftest.c 5 ld: /mingw/lib/crt2.o:

Re: [Haskell-cafe] IDE support

2007-04-22 Thread Claus Reinke
What IDE support is available for Haskell (Visuall Haskell, EclipseFP), anything else? in addition to the vim plugins already mentioned, i've got a few old ones at http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/ the page is many years old, but the logs indicate that many

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-21 Thread Claus Reinke
seems Simon has got himself a tricky problem. i was about to hit reply to his first call, but then i browsed through the oscon site, and thought that perhaps my background isn't close enough to the intended audience to make useful suggestions, not to mention the concrete examples asked for. but

Re: [Haskell-cafe] Re: Translating perl - haskell, string fill ins with an error on invalid inputseems awfullycomplex.Is there a way to simplify?

2007-04-16 Thread Claus Reinke
With regards to the variable interpolation in strings problem, .. as i mentioned, it is not difficult to hack something up, and in many cases, efficiency doesn't matter much for this part of the problem (though a standard, efficient, well-designed library would be welcome). but if we compare

Re: [Haskell-cafe] Re: Translating perl - haskell, string fill ins with an error on invalid inputseems awfullycomplex. Is there a way to simplify?

2007-04-14 Thread Claus Reinke
by utilizing Text.Printf.printf, extracting some more common functionality for the lookups, and changing the error handling (check for errors before giving results, but use throwError instead of error, letting the caller decide whether errors are fatal or not), we arrive at something like:

Re: [Haskell-cafe] Left-factoring with Parsec

2007-04-14 Thread Claus Reinke
x = x a + b Now use high school algebra x = x*a + b x - x*a = b x*(1-a) = b x = b / (1-a) x = b * 1/(1-a) Now you have to remember that the Taylor series expansion of 1/(1-a) is 1/(1-a) = 1 + a + a^2 + a^3 + a^4 + ... OK, now put your grammar hat back on. What's 1 | a | aa | aaa

Re: [Haskell-cafe] Re: Translating perl - haskell, string fill ins with an error on invalid inputseems awfully complex. Is there a way to simplify?

2007-04-13 Thread Claus Reinke
Answering my own plea for help, I now have the following, which seems neater to me. checking Maybes is best done in the Maybe Monad, or if you need specific error messages, using maybe. that, in turn can be abstracted out into a lookup with error message. once the checking is done in the

Re: [Haskell-cafe] generate Haskell code from model

2007-04-13 Thread Claus Reinke
This is true only for programming in the small, isn't it? my favourite opinion on that subject was expressed, back in 1984, in Burstall, Lampson A kernel language for modules and abstract data types http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-1.html paraphrasing:

Re: [Haskell-cafe] Profiling makes memory leak go away? Is Haskell apractical language?

2007-04-10 Thread Claus Reinke
reply = parse ... -- Lazily evaluated tokens = rTokens reply -- Has some values immediately list = D.toList tokens -- Has some values immediately mapM_ list print -- Start printing immediately! .. reply = parse ... -- Lazily evaluated result = rResult reply -- Lazy; has value when parsing is

Re: [Haskell-cafe] Re: A question about functional dependencies andexistential

2007-03-29 Thread Claus Reinke
readers of this thread might find ghc ticket #1241 relevant http://hackage.haskell.org/trac/ghc/ticket/1241 class T root pos sel | pos - root, root - sel where f :: pos - sel - Bool instance T root (Any root) sel But the same applies to the second functional dependency and the type

Re: [Haskell-cafe] Monad/Functor Book

2007-03-27 Thread Claus Reinke
I've thought about writing extended tutorials on the relationship between Haskell programming and category theory you might find this a useful reference/starting point then: http://citeseer.ist.psu.edu/62964.html An Introduction to Category Theory, Category Theory Monads, and Their

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

2007-03-25 Thread Claus Reinke
why do people insist that what they don't need has no right to live? also, there doesn't seem to be anything left in the Prelude itself, it just re-exports everything from one particular collection of modules. so the Prelude isn't really a useful target for complaints anymore, only the

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

2007-03-25 Thread Claus Reinke
Vivian McPhail wrote: What I want to push is a 'mathematically sound' numeric prelude. A proper numerical prelude should have bona fide mathematical obects like groups, rings, and fields underlying common numerical classes. .. Some classes would become even more important: monoid, groupoid,

Re: [Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-21 Thread Claus Reinke
[trigger garbage collection when open runs out of free file descriptors, then try again] so, instead of documenting limitations and workarounds, this issue should be fixed in GHC as well. This may help in some cases but it cannot be relied upon. Finalizers are always run in a separate thread

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-20 Thread Claus Reinke
[left-fold operator for enumerating the lines of a text file] .. enumLines :: (a - String - Either a a) - a - FilePath - IO a enumLines iter accum filename = do h - openFile filename ReadMode flip fix accum $ \iterate accum - do try_line - try (hGetLine h) case try_line of

Re: [Haskell-cafe] Matrices in Haskell

2007-03-20 Thread Claus Reinke
When you tried using Arrays, I presume you used an array indexed by a pair (i,j), and just reversed the order of the index pair to switch from row-wise to column-wise access? It's hard to see how that would slow you down. Perhaps the slowdown was caused by excessive array copying? the

Re: [Haskell-cafe] Matrices in Haskell

2007-03-20 Thread Claus Reinke
it seems unlikely to me that this would cause a degradation in performance with respect to lists... that might depend on the number of operations per transposition, i guess. lists and explicit transpositions make it very obvious what is going on in terms of iteration order, so i would be

Re: [Haskell-cafe] Re: flip fix and iterate

2007-03-20 Thread Claus Reinke
Haskell has a way of making one feel dumb. This is by far the most challenging programming language I've ever used. i wouldn't see either as a particularly positive attribute. a language should enable, explain, encourage, and perhaps inspire. if it also leaves you feeling that you could do

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-15 Thread Claus Reinke
Not necessarily so, since you are making assumptions about the timeliness of garbage collection. I was similarly sceptical of Claus' suggestion: Claus Reinke: in order to keep the overall structure, one could move readFile backwards and parseEmail forwards in the pipeline, until the two meet

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-15 Thread Claus Reinke
http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AHandle GHC note: a Handle will be automatically closed when the garbage collector detects that it has become unreferenced by the program. However, relying on this behaviour is not generally recommended: the

Re: [Haskell-cafe] How do I avoid stack overflows?

2007-03-15 Thread Claus Reinke
I'm trying to write some code which involves lots of matrix multiplications, but whenever I do too many, I get stack overflows (in both GHCi 6.4.2, and Hugs May 2006). The following code exhibits the problem. .. I tried to fix the problem using seq, as follows: iterate' f x = x : seq x'

lazily handling exceptions in lazy sources (Re: [Haskell-cafe] Re: Takusen and strictness, and perils of getContents)

2007-03-14 Thread Claus Reinke
Is this really a solution? Currently, getContents reports no errors but does perfect error recovery: the result of the computation prior to the error is preserved and reported to the caller. Imprecise exceptions give us error reporting -- but no error recovery. All previously computed results are

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Claus Reinke
When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal with this situation without making significant changes? .. 1. Read contents of all files returning a

Re: [Haskell-cafe] Re: idea for avoiding temporaries

2007-03-13 Thread Claus Reinke
Looking at the implementation of DiffArrays, there are some obvious optimisations that aren't done. and don't forget that it uses MVar instead of IORef to be thread-safe I don't see any obvious optimisations there - some kind of thread-safety is essential. We could try IORef and

Re: Re[4]: [Haskell-cafe] idea for avoiding temporaries

2007-03-12 Thread Claus Reinke
1) readArray m (i,j) yes, indeed. since we are dealing in bulk operations, we might as well take advantage of that, so dropping the repeated bounds-checks inside the loops makes a lot of sense. no, i say here only about memory leaks. of course, unsafeRead omits bounds checking but more

Re: Re[4]: [Haskell-cafe] idea for avoiding temporaries

2007-03-12 Thread Claus Reinke
to handle the 2d indexing, i replaced readArray m (i,j) by readMatrix m (i,j): {-# INLINE readMatrix #-} readMatrix m ij = unsafeRead m (unsafeIndex matrixBounds ij) matrixBounds :: ((Int,Int),(Int,Int)) matrixBounds = ((1,1),(n,n)) i'm still trying to understand why unsafeIndex

Re: [Haskell-cafe] idea for avoiding temporaries

2007-03-11 Thread Claus Reinke
* The algorithm as written already tries to express minimal storage. The only question is, do +=, -=, and := update their left-hand side in place, or do we think of them (in the Haskell model of the universe) as fresh arrays, and the previous values as newly-created garbage? My challenge

Re: Re[2]: [Haskell-cafe] idea for avoiding temporaries

2007-03-11 Thread Claus Reinke
Hi Bulat, obviously, arrays version should create no temporary cells. that's why the memory traffic surprised me. i knew there had to be something wrong. the problems was mainly due to 2 factors: 1) readArray m (i,j) yes, indeed. since we are dealing in bulk operations, we might as well

Re: [Haskell-cafe] Re: HS-Plugins 1.0 chokes on simple test, WinXP GHC-6.6

2007-03-10 Thread Claus Reinke
I'm running cygwin on WinXP and got a different failure (below) from the latest darcs hs-plugins. Line 11 is right after the TOP definition. Does anyone have a theory about what's going on here? - Conal looks like the TOP and GHC_LIB_PATH values are the output of external commands, such as

Re: [Haskell-cafe] idea for avoiding temporaries

2007-03-09 Thread Claus Reinke
i never quite understood why DiffArrays are so slow at the moment, so perhaps this is a good opportunity to ask for enlightenment on this issue?-) it seems i should qualify that. some simple-minded testing shows that DiffArrays do become faster than Arrays if the arrays get big enough. for

Re: [Haskell-cafe] idea for avoiding temporaries

2007-03-09 Thread Claus Reinke
On Fri, Mar 09, 2007 at 04:02:04PM -, Claus Reinke wrote: but if one does whole-array updates, there isn't much to be gained by avoiding intermediate copies, is there? whether you fill a new memory area, or overwrite an old one, you still have to loop through the whole thing, writing

Re: [Haskell-cafe] idea for avoiding temporaries

2007-03-09 Thread Claus Reinke
I've been following this discussion with interest, as I've been looking in some detail at conjugate gradient algorithms as part of my .. I'd love to hear if anyone has insights / pointers to related work on any of the issues above; I'm especially keen to learn if there's work I didn't know

Re: [Haskell-cafe] idea for avoiding temporaries

2007-03-08 Thread Claus Reinke
my line of work). This got me thinking about one of the largest problems with writing serious numerical code in Haskell, which is that of memory consumption and avoiding temporary variables. ... pretty high-level pure functional code, while the RTS can realize at run-time that we have the only

Re: [Haskell-cafe] idea for avoiding temporaries

2007-03-08 Thread Claus Reinke
Except that DiffArrays are slow and expensive in both space and time (compared with strict unboxed arrays). They necesarily hold boxed values so you pay a factor of at least two in space cost (for arrays of Doubles) right off the top, and there's no way you could recover that. I'll admit that

Re: [Haskell-cafe] Re: Takusen and strictness, and perils of getContents

2007-03-07 Thread Claus Reinke
Is this really a solution? Currently, getContents reports no errors but does perfect error recovery: the result of the computation prior to the error is preserved and reported to the caller. Imprecise exceptions give us error reporting -- but no error recovery. All previously computed results are

Re: [Haskell-cafe] Re: MPTCs and rigid variables

2007-03-07 Thread Claus Reinke
hi mm (?-), F, FD, FC, AT, SPJ ;) WTH does it mean? sorry about this acronymitis :) there was a lengthy debate about some of these things in the context of haskell' a year or so ago, and i just fell back into the mood, forgetting to explain my acronyms before using them again F: System

Re: [Haskell-cafe] Re: MPTCs and rigid variables

2007-03-07 Thread Claus Reinke
ATs are not in any of the official GHC releases... Are they in the CVS head? darcs, these days;-) but yes, from 6.7. see: announcement http://article.gmane.org/gmane.comp.lang.haskell.general/14447 main? info page http://haskell.org/haskellwiki/GHC/Indexed_types ghc status, with new features

Re: [Haskell-cafe] IO and lazyness.

2007-03-06 Thread Claus Reinke
Also, following Jeremy's advice, I replaced the last line of rechf2 with return $! rech r $ lines f and indeed it works. I don't understand why it doesn't without the ! The documentation for hGetContents says the items are read on demand. the function rech needs the strings so they

Re: [Haskell-cafe] MPTCs and rigid variables

2007-03-06 Thread Claus Reinke
Error message: Inferred type is not as polymorphic as type signature claims. Inferred type: [Char] Expected type: [a] Provided by the type signature: foo :: [a] at ~/foo.hs:1 (`a', a polymorphic type variable, could not be unified with `Char', a monotype.) In the expression: hello at

Re: [Haskell-cafe] MPTCs and rigid variables

2007-03-06 Thread Claus Reinke
ps. i was somewhat shocked to read that SPJ wants FDs gone. Why? Simon has good taste. :) de gustibus non est disputandum ;) FD have uses and problems and AT have uses and problems. starting anew with the latter doesn't fix the problems, it just changes their form. if AT are meant to

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

2007-03-05 Thread Claus Reinke
[feature request near the end] Hi Neil, Documentation isn't my strong point :) i noticed that you often reply to feature requests by pointing to undocumented tools/features, either already released in secret, or forthcoming. not that it isn't nice to have those tools, but won't you lose

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

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

Re: [Haskell-cafe] Re: wanted: haskell one-liners (in the perl senseof one-liners)

2007-03-04 Thread Claus Reinke
I think I could have most of the oneliner goodness of h4sh, without having to do the module install, if I could figure out a way to include modules with ghc -e. i confess myself to be among those who underappreciated ghc -e, until this thread:) as Joachim said (thanks for starting this,

Doc.vim - Haddocks from Vim (Re: [Haskell-cafe] Proposal: simple interface to libraries Haddock)

2007-03-03 Thread Claus Reinke
Again, the problem with this script is that it requires you know the package name for the function you're looking up. I see this as an over-burdenous requirement on the user. okay. sometimes i know/guess the module i'm looking for, but not the item. sometimes i recall the item i'm looking for,

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

2007-03-02 Thread Claus Reinke
http://docs.haskell.org/Data.Map.funcname this reminded me that haddock has long generated files with paths and relative urls that allow you to do that kind of thing, if slightly cryptically, and that i have long wanted to access the local haddocs from vim. since i'm a bit slow learning about

Re: [Haskell-cafe] Re: Code and Perf. Data for PrimeFinders(was:Genuine Eratosthenes sieve)

2007-02-28 Thread Claus Reinke
Melissa, thank you for taking my comments as constructively as they were meant. and not to worry, i'm sure i'm not the only one who enjoyed this little exercise and learned a lot from it!-) and even if we've found more that you expected, you're quite right, one doesn't get anywhere unless

bytestring vs polymorphic contiguous lists Re: [Haskell-cafe] Re: Using loop fusion for writing efficenthigh-level code Re[2]:[Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-28 Thread Claus Reinke
The main example of course is ByteString fusion as presented in our recent paper: http://www.cse.unsw.edu.au/~dons/papers/CSL06.html btw, why did you restrict yourself to improving [Char], rather than [a]? naively, it would seem to me that most of the framework should work just as well for

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

2007-02-27 Thread Claus Reinke
I hoped at least to stimulate interest in repeating GP experiment with latest GHC version. until that happens, I'd be wary to draw too many conclusions for today's applications from this paper. two orders of magnitude difference would seem to imply programming problems to me (though the

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

2007-02-27 Thread Claus Reinke
It'd be interesting to get the real code for this. Partly to just try optimising it but more so as a real test case for list/array fusion. As far as I see, there's no reason that consuming an assoc list of a bool vector with a foldl' (the ' is probably essential) should be slow. If it's fused

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was:Genuine Eratosthenes sieve)

2007-02-25 Thread Claus Reinke
Algorithm 10^310^4 10^5 10^6 10^7 10^8 Reinke0.04 1.2141.00- - - - Reinke is the ``applyAt'' algorithm Claus Reinke posted here while I'm not unhappy that this code is performing reasonably well, it was mostly an attempt to get

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders(was:Genuine Eratosthenes sieve)

2007-02-25 Thread Claus Reinke
This isn't a variant of the folklore sieve, it's actually the real one! :-) well, one thing i was trying for (and what perhaps one might like to see in a paper), is a way of relating the various code alternatives to each other, with suitably similar intermediate stages. not quite as detailed

Re: [Haskell-cafe] Re: Genuine Eratosthenes sieve [Was: Optimizationfun]

2007-02-20 Thread Claus Reinke
i have to say that i find the folklore sieve quite acceptable as a sieve, whereas the faster test-against-primes is obviously different. but the discussion has prompted me to write yet another sieve, perhaps more acceptable to purists. instead of using (mod p) repeatedly and filtering

Re: [Haskell-cafe] Does laziness make big difference?

2007-02-16 Thread Claus Reinke
So, as I understand, choosing default laziness was just experimental design decision in order to answer the question: how good lazy language can be. I am practically convinced, that lazy evaluation included in the _right_ places can be extremely useful. I didn't state the question as strict vs

Re: [Haskell-cafe] Programming an Evaluation Context

2007-02-15 Thread Claus Reinke
in structural operational semantics, an evaluation context is often used to decompose an expression into a redex and its context. In a formal semantics on paper, an expression can just be pattern matched over the grammar of an evaluation context. If one wants to implement such a semantics in

Re: [Haskell-cafe] Programming an Evaluation Context

2007-02-15 Thread Claus Reinke
-- evaluation contexts, parameterized by rule to apply ctxt rule e = rule e `mplus` left (ctxt rule) e `mplus` right (ctxt rule) e left act e = do { (Plus l r) - return e; lv - act l; return (Plus lv r) } right act e = do { (Plus lv@(Val _) r) - return e; rv - act r; return (Plus lv

Re: [Haskell-cafe] IO is not a monad

2007-02-12 Thread Claus Reinke
Adding seq ruins eta reduction. For normal order lambda calculus we have '\x.f x = f' (x not free in f). If we add seq this is no longer true. isn't that a problem of seq (and evaluation in Haskell generally) not being strict enough (ie, forcing evaluation only to weak head normal form

Re: [Haskell-cafe] Re: Space Leak Help

2007-02-04 Thread Claus Reinke
pad causes a stack overflow and pad1 uses up about 6m of heap. pad1 xs = xs ++ [0x80] ++ ps where l = length xs pl = (64-(l+9)) `mod` 64 ps = replicate pl 0x00 wild guess: if you compute the length when the consumer reaches ps, you hold on to a copy of xs longer than needed,

Re: Re[2]: [Haskell-cafe] Channel9 Interview: Software Composability andthe Future of Languages

2007-02-01 Thread Claus Reinke
while (hGetBuf h buf bufsize == bufsize) crc := updateCrc crc buf bufsize break if crc==0 print crc inContT $ callCC $ \break - do flip execStateT 0 $ do whileM (liftM (== bufsize) (hGetBuf h buf bufsize)) $ do modifyM (updateCrc buf bufsize)

Re: Re[4]: [Haskell-cafe] Channel9 Interview: Software Composabilityandthe Future of Languages

2007-02-01 Thread Claus Reinke
while (hGetBuf h buf bufzise .==. (return bufsize)) $ do crc =: updateCrc crc buf bufsize breakIf ((val crc) .==. (return 0)) `orElse` do printM (val crc) od your solution is just to make lifted copy of each and every pure operation. so one should define 2^n

Re: [Haskell-cafe] some way to reverse engineer lambda expressionsout of the debugger?

2007-01-11 Thread Claus Reinke
[EMAIL PROTECTED]: Bulat Ziganshin [EMAIL PROTECTED] wrote: tphyahoo wrote: *UnixTools explodeLambda( map (*) [1,2] ) [(\x - 1*x),(\x - 2*x)] Have a play with this, from Claus Reinke: http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/R.hs Regards, Malcolm

Re: [Haskell-cafe] Re: Writing Haskell For Dummies Or At Least ForPeople Who Feel Like Dummies When They See The Word 'Monad'

2006-12-14 Thread Claus Reinke
+1 . I would love to read something that is the equivalent of 'design patterns', but for functional languages.. I want to learn how to think functionally. If you want to learn how to think functionally, forget you ever heard the words design pattern. There shouldn't be patterns in your

Re: [Haskell-cafe] Aim Of Haskell

2006-12-13 Thread Claus Reinke
The reason why Haskell is academic-centric is that it was originally conceived by academics, and they were interested in doing research into language design and implementation .. shouldn't we make this used to be academic-centric? People outside academia who might be inclined to take on some

Re: [Haskell-cafe] Aim Of Haskell

2006-12-13 Thread Claus Reinke
well, if Sun hadn't have released a version of smalltalk with a funny c like syntax, you might have seen some interesting developments in the mid 90's yes, perhaps. but now that funny smalltalk is open source, the self team has been released from indenture (after Scheme and Self people, Sun is

Re: a cabal/database lib experience (was: [Haskell-cafe]Trivialdatabase access in Haskell)

2006-12-12 Thread Claus Reinke
We have made a number of assumptions which Paul exposed: - users should know to do darcs get, then runhaskell Setup.hs configure/build/install - users should know to look for Haddock docs - users should know how to look for and install dependent libraries (Cabal-1.1.6.1, in this case) and there

Re: [Haskell-cafe] Re: a cabal/database lib experience

2006-12-12 Thread Claus Reinke
absolutely, this has occurred to me too. There should be a stanard Cabal README file, and Don's mkcabal tool could drop it in the tree. This occurred to me too. My current plan for mkcabal is that it creates: foo.cabal Setup.lhs README LICENSE based on a series of interactive

Re: [Haskell-cafe] Aim Of Haskell

2006-12-12 Thread Claus Reinke
Maybe we can claim it should be 'has kell', where kell is something cool, and no cornflakes. It has kell. if there was an implementation of Haskell on Cell processors, it could be has cell.. I wonder if knowing what people are going to do with your name is sufficient to put students off

a cabal/database lib experience (was: [Haskell-cafe] Trivial database access in Haskell)

2006-12-11 Thread Claus Reinke
if you're using Haskell at all, you *are* the Haskell community. [..lots of I searched, I found, I tried, I got this error, I thought, I tried this workaround, I got to this point, now I'm stuck here..] I just wanted to comment that I find this kind of experience report very helpful,

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

2006-12-09 Thread Claus Reinke
Hello yourself!-) Two days ago I have found Haskell in Internet. It sounds very nice. I have read some articles, few examples, ... yes it sounds nice. you need to try it as well. haskell.org has information, tutorials, interactive implementations (and to answer the likely follow-on question:

Re: [Haskell-cafe] WANTED: grey line layout boxes in vim and emacs

2006-12-08 Thread Claus Reinke
something like the attached vim script might work for small sources (ignores all layout rules and keywords, just records increase/decrease of indentation stack; builds up a rather large pattern of positions for highlighting via :match). (don't assume that this is the only, let alone the right

Re: [Haskell] Re: [Haskell-cafe] SimonPJ and Tim Harris explainSTM- video

2006-11-28 Thread Claus Reinke
also on the multi-version approach. but the particular reason I mentioned this was that it also tried to address the issue of composing transactions (discussion of which is explicitly excluded from the section 1.2 you refer to). for instance, compare the discussion and examples in Composable

Re: [Haskell-cafe] Difficult memory leak in array processing

2006-11-27 Thread Claus Reinke
In fact it turned out that the example code I posted did not exhibit the memory leak at all. It just took a /very long time/ to complete (compared to a Java version), but it did complete. My complete code, which also counted the instances of a given number from the array, does however exhibit the

Re: [Haskell] Re: [Haskell-cafe] SimonPJ and Tim Harris explain STM- video

2006-11-24 Thread Claus Reinke
this thread reminds me about something that I wanted to ask you. if I recall correctly, most of the literature references in STM papers are recent, so I wondered whether you are aware of this one: NAMING AND SYNCHRONIZATION IN A DECENTRALIZED COMPUTER SYSTEM SourceTechnical Report:

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

2006-11-15 Thread Claus Reinke
This isn't a trivial point. We know that error handling code is a major part of software cost--it can even dominate the cost of the correct case code (by a large factor). Erlang's program for the correct case strategy, coupled with good fault tolerance mechanisms, is one reason for its

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

2006-11-15 Thread Claus Reinke
Couldn't we just use rewrite rules to rewrite *transparently* all uses of fromJust to safeFromJust, tagging the call site with a location? .. Looks good! But that is deceiving: the assert was expanded before the rule fired, and refers to the rewrite rule source line (line 19), not the

<    1   2   3   4   5   6   >