[Haskell] ANN: scan-0.1.0.6, a style scanner for Haskell sources

2010-08-03 Thread Christian Maeder
Dear Haskell friends, I like to announce a new version of the style scanner for Haskell source files at http://hackage.haskell.org/package/scan documented under http://projects.haskell.org/style-scanner/ cabal update cabal install scan A short description is also here: http://haskell.org/com

[Haskell] Re: Please check your dependencies on fgl

2010-06-08 Thread Christian Maeder
Ivan Lazar Miljenovic schrieb: >> Although parsec-3 can be used as an replacement for parsec-2 it would >> have been better, they had different names (as argued elsewhere for the >> haskell platform). > > I'm sorry, I don't recall this discussion: care to summarise? http://www.haskell.org/piperma

[Haskell] Re: Please check your dependencies on fgl

2010-06-08 Thread Christian Maeder
Ivan Lazar Miljenovic schrieb: [...] we don't need to repeat a parsec-2 vs parsec-3 discussion. There are obviously different opinions that cannot be easily changed. >> Well, I've created a custom instance: >> http://trac.informatik.uni-bremen.de:8080/hets/browser/trunk/Common/Lib/Graph.hs >> and

[Haskell] Re: Please check your dependencies on fgl

2010-06-08 Thread Christian Maeder
Ivan Lazar Miljenovic schrieb: > We considered giving it a new name (fgl', etc.) but figured that in the > long term this wouldn't be advantagous. We feel that the situation is > analogous to QuickCheck: when the new version came out most people kept > using the old one until slowly the momentum s

[Haskell] ANN: scan-0.1.0.4, a style scanner for Haskell sources

2010-04-21 Thread Christian Maeder
I think, I've addressed the points made by Henning and Sebastian. (Don't forget to "cabal update".) Cheers Christian > Dear Haskell friends, > > I like to announce a Haskell style scanner at > http://hackage.haskell.org/package/scan > > documented under http://projects.haskell.org/style-scanne

[Haskell] ANN: scan-0.1.0.3, a Haskell style scanner

2010-04-19 Thread Christian Maeder
Dear Haskell friends, I like to announce a Haskell style scanner at http://hackage.haskell.org/package/scan documented under http://projects.haskell.org/style-scanner/ It's best used in conjunction with hlint http://community.haskell.org/~ndm/hlint/ and gives many suggestions regarding the file

[Haskell] Re: ANNOUNCE: multiset 0.1

2008-02-07 Thread Christian Maeder
> Hackage: > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/multiset-0.1 > Haddock: http://twan.home.fmf.nl/multiset/doc/ > Darcs: http://twan.home.fmf.nl/repos/multiset/ Seeing all these nice little packages (i.e. also bimap), is there a cute way to get a binary distribution - simil

[Haskell] Re: Nested guards?

2007-12-05 Thread Christian Maeder
Iavor Diatchki wrote: > Hi, > Lately I have been using pattern guards more than usual and I find > that occasionally I need to nest them (i.e., I have alternatives with > a common prefix). This seems to happen when I need to do some > preliminary checking, followed by some decision making. Here i

[Haskell] Re: ASCII higher than 127

2006-10-17 Thread Christian Maeder
Either convert your file to utf-8 encoding or read http://www.haskell.org/ghc/docs/6.6/html/users_guide/release-6-6.html GHC now treats source files as UTF-8 (ASCII is a strict subset of UTF-8, so ASCII source files will continue to work as before). However, invalid UTF-8 sequences are ignored in

[Haskell] Re: new release of Hugs / preprocessor usage

2006-05-16 Thread Christian Maeder
Ross Paterson wrote: On Tue, May 16, 2006 at 11:18:16AM +0200, Christian Maeder wrote: How do I use the preprocessor option -F of hugs? The problem is that cpphs (like other C preprocessors) puts #line directives in its output, and they're not Haskell. But you can tell it not to with

[Haskell] new release of Hugs / preprocessor usage

2006-05-16 Thread Christian Maeder
Ross Paterson wrote: We are pleased to announce a new major release of Hugs, How do I use the preprocessor option -F of hugs? Without this option hugs correctly reports: unexpected symbol "#" But adding "-Fcpphs" results in "Unable to load Prelude" Christian [EMAIL PROTECTED]:/local/home/ma

[Haskell] Re: compares :: Ord a => a -> a -> Ordering -> Ordering

2006-02-15 Thread Christian Maeder
Ben Rudiak-Gould wrote: I just realized that the class Ord should have an additional method: class Eq a => Ord a where compares :: a -> a -> Ordering -> Ordering compares x y d = case compare x y of { EQ -> d ; o -> o } ... How about: instance (Ord a, Ord b, Ord c, Ord d) => Ord

[Haskell] Re: Looking for a random-access sequence data structure

2006-01-13 Thread Christian Maeder
Christian Maeder wrote: seqInsert i v = Map.insert i v . Map.mapKeysMonotonic (\ j -> if j < i then j else j + 1) Sorry, only O(n) and not O(log n). The same would apply to delete. ___ Haskell mailing list Haskell@haskell.org http://www.haske

[Haskell] Re: Looking for a random-access sequence data structure

2006-01-13 Thread Christian Maeder
Duncan Coutts wrote: What's the semantics of insert? Does it replace an element, or does it shirt all the elements after it one step? It shifts all the elements after it one step. So that's why all the finite map types are no help. import Data.Map as Map seqInsert i v = Map.insert i v . Ma

[Haskell] Re: State Monad

2006-01-13 Thread Christian Maeder
Bruno Oliveira wrote: Can somebody point me out the exact CVS location of the State Monad implementation that ships with GHC? I am a bit lost in the CVS directory structure ... fptools/libraries/mtl/Control/Monad/State.hs Christian ___ Haskell maili

Re: [Haskell] more newbie questions regarding do syntax, mondic context & Data.HashTable

2005-12-29 Thread Christian Maeder
Hunter Kelly wrote: How can I get at the underlying value? Can I only access it from within a "do" construct? Yes, I'm afraid so Is there anyway to get at this function to return just True or False? No, (unless you use something unsafe that I would not recommend) Or has using something t

Re: [Haskell] WASH-Problem was Re: Haskell users survey--please respond!

2005-11-09 Thread Christian Maeder
Tomasz Zielonka wrote: Does it happen when you modify the cgi-program in the middle of a session? This is the biggest problem with WASH - to be able to rebuild the state from session log it needs the program structure to be constant. I work around it by copying the current cgi-program at the star

[Haskell] WASH-Problem was Re: Haskell users survey--please respond!

2005-11-09 Thread Christian Maeder
Aaron Denney wrote: I hit "Submit response and view previous responses" and it says "Unspecified action" and a "Try again..." hyperlink. I have the same problem even with our own cgi-program based on WASH and ghc-6.4.1 Cheers Christian ___ Haskell

Re: [Haskell] Read Instances for Data.Map and Data.Set

2005-10-20 Thread Christian Maeder
Christian Maeder wrote: Simon, clicking on any module does not work, currently Not Found The requested URL /ghc/docs/latest/html/libraries/base/Control.Arrow.html was not found on this server. Apache/2.0.46 (Red Hat) Server at www.haskell.org Port 80 Sorry, it works now after I cleared my

Re: [Haskell] Read Instances for Data.Map and Data.Set

2005-10-20 Thread Christian Maeder
Georg Martius wrote: Anyway since there was no response to S. Alexander Jacobson post [1], I decided to write these instances at least for GHC in the style of the other instances in GHC.Read. Who feels responsible for including something into Data.Set and Data.Map (recently I've proposed a ch

Re: [Haskell] ANNOUNCE: Haddock version 0.7

2005-08-24 Thread Christian Maeder
Hi, I've just noticed that haddock-0.7 creates Data-Map.html instead of Data.Map.html files (and links to these files)! I've actually proposed this change, but it does not fit to the currently released haddock documentation of the libraries. (Our web server used to reject the file Data.Map.html,

Re: [Haskell] writeFile for a looong string

2005-07-14 Thread Christian Maeder
Hi, maybe try using fullRender with defaults (mode=PageMode, lineLength=100, ribbonsPerLine=1.5) and "a" instantiated to "IO()" so that TextDetails can be appended to a file (handle). HTH Christian Johannes Waldmann wrote: > Dear all, > > I am writing a long string (several MByte) to a file, >

[Haskell] simple declarations proposal, was: offside rule question

2005-07-14 Thread Christian Maeder
Frederik Eaton wrote: > main = do > let a = (map (\x-> > x+1) --* > [0..9]) --* > print a seeing this, I wonder if do-statements (and qualifiers in list comprehensions) could be easily extended by an alternative for simple declarations (without mutual recursion and type sig

Re: [Haskell] line-based interactive program

2005-07-08 Thread Christian Maeder
Colin Runciman wrote: > output are less than a line! However, there is no need to build > line-buffering into the system, because it is easily defined in Haskell: > > buffer xs = foldl const xs xs I don't find it this easy nor a good programming practise. My interaction depends on the (subtle o

Re: [Haskell] line-based interactive program

2005-07-07 Thread Christian Maeder
Bulat Ziganshin wrote: > Hello Colin, > > Thursday, July 07, 2005, 4:33:39 PM, you wrote: type FilterProgram = [Line] -> [Line] > > CR> interact :: (String -> String) -> IO () > > and there is lines and unlines functions to do just what yopu need > > example: main = interact (unlines.filter

Re: [Haskell] line-based interactive program

2005-07-07 Thread Christian Maeder
mt wrote: > hi, > > i'd like to know how to write simply a line-based interactive program, that > is > one with which you have a 'talk'. I would start with: main = do putStrLn "Please enter text (or press return to exit):" s <- getLine if s /= "" then do putStrLn s

[Haskell] haddock

2005-06-22 Thread Christian Maeder
Hi, haddock generates html-Files named after the module. Since hierarchical modules contain dots, such files are seen to have multiple extensions (regardless of case) by our apache web server. http://httpd.apache.org/docs-2.0/mod/mod_mime.html#multipleext Unfortunately "map" is the extension fo

Re: [Haskell] translation of "kind"

2005-06-20 Thread Christian Maeder
Ralf Hinze wrote: > Am Montag, 20. Juni 2005 12:06 schrieb Christian Maeder: >>Even Peter Thiemann in "Grundlagen der funktionalen Programmierung" >>(1994) did not translate "Kind", although he used "geschönfinkelt" for >>"curry" (ho

Re: [Haskell] translation of "kind"

2005-06-20 Thread Christian Maeder
Wolfgang Jeltsch wrote: > can anybody tell me what the German translation of the word "kind" as used in > type theory and especially in Haskell is? Even Peter Thiemann in "Grundlagen der funktionalen Programmierung" (1994) did not translate "Kind", although he used "geschönfinkelt" for "curry" (h

Re: [Haskell] Undefined of Char.toUpper ?

2005-04-27 Thread Christian Maeder
Luo Shuli wrote: > Dear Haskellers, > I am a beginer of the haskell language and study it from < Haskell Tutarial>> of Hal Daume III. > Example from the tutarial: > Prelude> map Char.toUpper "Hello World" This works only with ghci > I try it on Hugs for windows32, compile error: > ERRO

Re: [Haskell] Haskell-mode 2.0

2004-11-26 Thread Christian Maeder
Stefan Monnier wrote: I have recently taken over maintainership of Haskell-mode, and after making a bunch of changes, I figured it would be a good idea to make a new release. You can find this new release at: http://www-perso.iro.umontreal.ca/~monnier/elisp/ Thank you! This release has seve

Re: [Haskell] Building from source

2004-10-06 Thread Christian Maeder
Simon Marlow wrote: If you don't want to build hood, then remove it from the tree. Did you perhaps check out *everything*? The right way is to check out fpconfig Ah, that was my error. I checked out everything by "cvs co fptools" instead of only doing "cvs co fpconfig". (When I read "fpconfig",

[Haskell] Building from source

2004-10-06 Thread Christian Maeder
Hi, after checking out fptools from cvs. The simple sequence $ autoreconf $ ./configure $ make failed in the directory hood, because the target boot is unknown there. Could/Should this be fixed? I know how to use mk/build.mk and the ProjectsToBuild variable. I don't need hood, but make still sho

Re: [Haskell] RFC: DData in hierarchical libraries

2004-03-08 Thread Christian Maeder
JP Bernardy wrote: http://users.skynet.be/jyp/DData/doc/index.html I only looked at Set and Map Any comment is welcome. (Including "I support this proposal" :)) Yes, I support this proposal. Maybe the documentation to the "0rdered lists" section can be improved. Set.toAscList is not really neces

Re: [Haskell] Re: Data.Set whishes

2004-02-20 Thread Christian Maeder
Koen Claessen wrote: And instead of: mapSet, emptySet, ... We have: Set.map, Set.empty, ... This is how Chris does it in Edison. and Daan Leijen in DData: http://www.cs.uu.nl/~daan/ddata.html Christian (Well, Set.map is actually missing there)

Re: [Haskell] Parsec question: attempted 'notMatching' combinator

2004-02-18 Thread Christian Maeder
Hi, In a local copy of Parsec.Prim I've added a primitive, that may be of help for your problem as well. consumeNothing :: GenParser tok st () consumeNothing = Parser (\state -> Consumed (Ok () state (unknownError state))) With this I've implemented: checkWith :: (Show a) => GenParser tok st

[Haskell] Program code storage space exhausted

2004-02-17 Thread Christian Maeder
Hi, does hugs Nov 2003 allow to increase the space for the program being loaded? (This is not the heap size!) Cheers Christian ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: [Parsec] Extracting line and column numbers

2004-01-13 Thread Christian Maeder
Tomasz Zielonka wrote: On Tue, Jan 13, 2004 at 12:44:10PM +0100, Stefan Holdermans wrote: abstract and I cannot extract the line and column numbers from a SourcePos value. What are my options? What about these? sourceColumn :: SourcePos -> Column sourceLine :: SourcePos -> Line These signatu

Re: incompatible signatur syntax within instance definition

2003-12-05 Thread Christian Maeder
I've just noticed that I used ghc with -fglasgow-exts. Without extensions hugs, ghc und nhc98 consistently need the constraint in the type signature (below) showsl :: Show a => List a -> ShowS Switching the extensions on, breaks this code, however (ghc only). Christian I wrote: Hi, if I tr

incompatible signatur syntax within instance definition

2003-12-05 Thread Christian Maeder
Hi, if I try to supply a signatur for the local function "showsl" below, then ghc rejects a constraint (Show a) whereas hugs (and nhc98) needs this constraint. What should be the correct notation? (apart from omitting any signature) Cheers Christian (BTW, I would appreciate if the (instantiat

Re: show function

2003-12-03 Thread Christian Maeder
rui yang wrote: > I want to print a function which itself have some functions as it's parameters > and will return some functions as the results, and I want to print out the > result, does anyone knows how to define the instance declaration of show class > to this function type? I don't know if

changed link

2003-10-15 Thread Christian Maeder
Hi, on: http://www.haskell.org/bookshelf/ the link for: Online Haskell Course by Ralf Hinze (in German). should be changed from: http://www.informatik.uni-bonn.de/~ralf/teaching/HsKurs_toc.html to: http://www.informatik.uni-bonn.de/~ralf/teaching/Hskurs_toc.html At least my browser seems to be ca

Re: "interact" behaves oddly if used interactively

2003-10-01 Thread Christian Maeder
Can actually someone supply an implementation of something like interact that does no pipelining for the argument "id"? Simply doing "putStr !$ f !$ s" was not enough! Yes, of course. Your code above only forces the evaluation of the first cons-cell of the list, which is not enough. You want to

Re: "interact" behaves oddly if used interactively

2003-10-01 Thread Christian Maeder
I wrote: But looking at the two actions of interact: interact f = do s <- getContents putStr (f s) >> I would expect the first action to be finished before the second Keith Wansbrough wrote: Why? Because the actions are written down in that order? Why not? Why should I expect pipelining? Oc

Re: "interact" behaves oddly if used interactively

2003-10-01 Thread Christian Maeder
Colin Runciman wrote: Let not the eager imperative tail wag the lazy functional dog! Ideally functional programs should be independent of evaluation strategy and I assume that this is the case for about 90% of all Haskell programs. This leaves maybe the head or only the nose for laziness of the

Re: "interact" behaves oddly if used interactively

2003-10-01 Thread Christian Maeder
Malcolm Wallace wrote: [...] Surely the name suggests that "interactive" behaviour is required, i.e. exactly some interleaving of input and output. The chunk-size of the interleaving should depend only on the strictness of the argument to "interact". I'm not happy that interleaving depends on the

Re: "interact" behaves oddly if used interactively

2003-10-01 Thread Christian Maeder
I wrote: "main=interact id" basically echoes every line of my input, whereas "main=interact show" correctly waits for EOF before outputting something. The unix "cat" and "sort" behave in a similar way ("sort" obviuously has to wait for the last line.) Still I would regard it to be more "pure" (o

Re: "interact" behaves oddly if used interactively

2003-09-30 Thread Christian Maeder
"main=interact id" basically echoes every line of my input, whereas "main=interact show" correctly waits for EOF before outputting something. Which of these are you claiming is wrong? I guess "interact" does what it should, but I think it should be changed to avoid interleaved in- and output. l

"interact" behaves oddly if used interactively

2003-09-30 Thread Christian Maeder
Hi, For GHC (6.0.1) "main=interact id" basically echoes every line of my input, whereas "main=interact show" correctly waits for EOF before outputting something. Furthermore the buffering mode must be "LineBuffering". If I explicitely set the buffering to "NoBuffering" I'm not able to enter EOF

Re: unary minus

2003-09-05 Thread Christian Maeder
I wrote: > I wonder why Haskell only allows the unary minus on the left side of an expression ("lexp" in the grammar). The unary minus may also occur on the right hand side (rule: "exp -> lexp"). So "-1 == -1" is correct, because "==" has lower precedence than "-". Also "-1*2" is correct althou

unary minus

2003-09-04 Thread Christian Maeder
Hi, I wonder why Haskell only allows the unary minus on the left side of an expression ("lexp" in the grammar). There should be no problem to uniquely recognize an unary minus right beside an operation symbol ("qop"). Does the grammar allow two consecutive qops in other cases? This would allo

Re: need some info/help

2003-09-04 Thread Christian Maeder
Brett G. Giles wrote: Naturally, there are many great resources for this at www.haskell.org Ensure you check out both Alex and Happy for the parsing and sourcing. (note that Alex is currently being re-written, I'm not sure if the latest public version has the new format/syntax) I think, parsing (i

Re: User-Defined Operators (ad-hoc overloading)

2003-07-22 Thread Christian Maeder
Andrew J Bromage wrote: As a matter of interest, is there a known worst-case complexity for the precomputation required by Earley's algorithm to handle arbitrary CFGs? Earley's algorithm handles exactly arbitrary (in particular ambiguous) CFGs without precomputation. see i.e. Aho,Ullman, "The The

Re: User-Defined Operators (ad-hoc overloading)

2003-07-21 Thread Christian Maeder
Mere overload resolution (over monomorphic types) is not NP-hard. (This is only a common misconception.) I can only repeat my above sentence. No, but as you note below, the "interesting" cases are. Most of the more interesting number-like types are polymorphic (e.g. Complex, Ratio). This kind of

Re: referring to deeply embedded definitions

2003-07-18 Thread Christian Maeder
Hal Daume wrote: Suppose I have: module M1 where import M2 foo = 'a' and module M2 where import M3 and module M3 where foo = True Now, inside M1, I want to write something like: bar = if M2.foo then M1.foo else 'b' M2 must reexport "foo": module M2 (foo) where import M3 __

Re: User-Defined Operators (ad-hoc overloading)

2003-07-18 Thread Christian Maeder
Andrew J Bromage wrote: Of course you could always allow overloading _without_ requiring module qualification (unless the overloading can't be resolved using type information). It'd make type checking NP-hard, but I seem to recall that it's already more complex than that. Mere overload resolution

Re: User-Defined Operators

2003-07-17 Thread Christian Maeder
Johannes Waldmann wrote: I do think that self-defined operators make a programm less readable. I quite like most combinators from the pretty-printer or parsing libraries! And what's absolutely horrible (IMHO) is to allow the user to declare arbitrary precedence and associativity for his creations

Re: Reading/Writing Binary Data in Haskell

2003-07-09 Thread Christian Maeder
There isn't a standard mechanism for binary I/O. NHC98 contains the York Binary library. Can someone tell me if this is available for other Haskell systems? And didn't GHC also provide binary I/O? How does the GHC itself read/write binary data, since the interface files (*.hi) produced by GHC a

Re: haskell-mode and xemacs

2003-07-03 Thread Christian Maeder
Sven Panne wrote: Christian Maeder wrote: > whenenver I open a haskell file (*.hs) with my xemacs I get an annoying > warning in a splitted window: > > (1) (error/warning) Error in `post-command-hook' (setting hook to > nil): (void-variable imenu--index-alist) [...] Try

haskell-mode and xemacs

2003-07-03 Thread Christian Maeder
Hi, whenenver I open a haskell file (*.hs) with my xemacs I get an annoying warning in a splitted window: (1) (error/warning) Error in `post-command-hook' (setting hook to nil): (void-variable imenu--index-alist) The modes (Haskell Font Ind Doc) seem to work, though. My xemacs has [version

Re: forall quantifier

2003-06-06 Thread Christian Maeder
I forget whether I've aired this on the list, but I'm seriously thinking that we should change 'forall' to 'exists' in existential data constructors like this one. One has to explain 'forall' every time. But we'd lose a keyword. "exists" (like "forall" in ghc only) could be used independently in a

./configure

2002-12-06 Thread Christian Maeder
Hi, when installing ghc and hugs under SuSE linux 8.1 I got "configure: error: can not guess host type; you must specify one" It worked after I added "--host=i386-linux" Christian ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mail

nub

2002-11-26 Thread Christian Maeder
> > What does "nub" stand for? (This is the first I've heard of it.) > Hmm, maybe that's not such a great explanation. I wonder who can come up > with the best acronym? My contribution is > > "Note Unique Bits" "no duplicates" (or "no doubles") although that's no acronym Christian __

Re: Contexts on data type declarations

1999-05-25 Thread Christian Maeder
> > > But what type does the selector 'item' have? Phil, Mark and Jeff think: > > > > > > item :: Ord a => Tree a -> a > > > > This looks correct to me, too. > > > > If an order is needed to construct a tree, say a search tree, the very same > > order is (or may be) needed to select an i

Re: RE: Contexts on data type declarations

1999-05-18 Thread Christian Maeder
> But what type does the selector 'item' have? Phil, Mark and Jeff think: > > item :: Ord a => Tree a -> a This looks correct to me, too. If an order is needed to construct a tree, say a search tree, the very same order is (or may be) needed to select an item, e.g. by searching! Chri