[Haskell-cafe] [URGENT] DNS problems at haskell.org?
On Fri, Dec 17, 2010 at 05:01:45PM +0300, Eugene Kirpichov wrote a message of 82 lines which said: > For a couple of friends of mine, hackage.haskell.org happens to > resolve to something strange (parked domain), though haskell.org works > ok. This might be something to tell to haskell.org admins. Indeed, someone forgot to pay the bill and the domain will soon be sold or deleted. % whois haskell.org ... Last Updated On:17-Dec-2010 10:12:28 UTC ... Sponsoring Registrar:Network Solutions LLC (R63-LROR) ... Registrant ID:DOMAIN-RESALE Registrant Name:Pending Renewal or Deletion ... Name Server:NS1.PENDINGRENEWALDELETION.COM Name Server:NS2.PENDINGRENEWALDELETION.COM signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'
On Wed, Sep 24, 2008 at 08:14:34PM -0400, Stephane Bortzmeyer <[EMAIL PROTECTED]> wrote a message of 34 lines which said: > I cannot compile Streams 0.1: This problem is experienced by other people: http://groups.google.com/group/fa.haskell/browse_thread/thread/bafa0006f9fb2ba7 but nobody seems to know what to do? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: cabal upgrade
On Wed, Oct 01, 2008 at 08:58:53AM +0100, Malcolm Wallace <[EMAIL PROTECTED]> wrote a message of 23 lines which said: > Indeed, the advice given by each of these tools IIRC was to update > every time you used it, before doing anything else. (So why was it > a manual task then?) You can put it in cron (Ubuntu does it by default). > On the other hand, every one of those tools eventually failed for me > on the update step, leaving me with an inconsistent and non-working > configuration. ??? If something is wrong in the update step, the installed packages are not modified. If the database of *available* packages is corrupted (something I never saw with apt/aptitude or Gentoo's portage), then you cannot install new packages but existing packages work fine (the *available* packages database is distinct from the *installed* packages database). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'
On Wed, Sep 24, 2008 at 08:24:09PM -0400, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote a message of 13 lines which said: > You probably have 6.8.2's Cabal (in the 1.2 series), while the package > requires 1.4 (and 1.2 isn't smart enough to check versions). How can you check that it requires 1.4 ? The Cabal file says: -- Tested-with: hugs 2003, hugs March2005, ghc 6.4.2, ghc 6.6 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [Streams] Couldn't match expected type ?`Distribution.Verbosity.Verbosity'
I cannot compile Streams 0.1: % darcs pull Pulling from "http://software.pupeno.com/Streams-0.1";... No remote changes to pull in! % make runhaskell Setup.lhs configure Setup.lhs:11:53: Couldn't match expected type `Distribution.Verbosity.Verbosity' against inferred type `IO FilePath' In the first argument of `readPackageDescription', namely `pkg_descr_file' In a 'do' expression: pkg_descr <- readPackageDescription pkg_descr_file In the expression: do pkg_descr_file <- defaultPackageDesc pkg_descr <- readPackageDescription pkg_descr_file let isWindows = "mingw" `isPrefixOf` System.Info.os config = ... defaultMainNoRead config make: *** [.setup-config] Error 1 % ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.2 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [newbie question] Memoization automatic in Haskell?
On Sun, Jan 13, 2008 at 12:25:53AM +0100, Henning Thielemann <[EMAIL PROTECTED]> wrote a message of 28 lines which said: > Caching is not the default, but you can easily code this by > yourself: Define an array and initialize it with all function > values. Because of lazy evaluation the function values are computed > only when they are requested and then they persist in the array. It works only if the argument of the function is an integer or an enumerated type. If the argument is a string and you do not know the string values in advance, you cannot use the array. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [IETF Apps meeting] A Theory of Templating Languages
The IETF (http://www.ietf.org/) holds a meeting of its Application Area and is looking for papers. In a position paper, Joe Gregorio asked for information about the theory of templating languages. Giving the interest here in DSLs and conceptualization, he may find on this list the help he wants and the references he searches: >From: "Joe Gregorio" <[EMAIL PROTECTED]> >Date: December 14, 2007 8:20:17 AM PST >Subject: Re: Position papers due Dec 14 > >Here is my brief position paper: > >Working on the URI Templating specification has made me realize that >there is a pretty substantial hole >in computer science theory: a lack of a theory of templating >languages. For example, the current version of >URI Templates is not Turing-complete, which excludes a whole bunch of >possible attacks. In the specification I state: > >On the balance, the template processing is not Turing complete, >thus avoiding a number of > security issues, ala the billion-laughs attack of XML DTDs. > >I was rightly called out on this on the W3C URI mailing list: > >This reads a little odd, as not being Turing-complete is not >sufficient >to avoid the attack. (And DTDs are not Turing-complete either.) > >The criticism is correct. The problem is that I don't know of any >finer grained levels of classifications >of templating languages than Turing/non-Turing, and not only for >security reasons, but for general capabilities. > >For example, if there were classes of templating languages, I could >say that URI Templates fell into 'class X', and >if that class had a known set of limitations and capabilities then I >could say that URI Templates thus had those >limitations and capabilities. The weakness to the billion laughs >attack comes from two facets of DTD usage, the >first being that templates can be defined in terms of other templates, >and the second is that the depth of template >definition, in terms of other templates, isn't limited. But the >converse isn't true, that is, I don't have a general >theory of templating to lean on that says since URI Template >expansions are never defined in terms of other >expansions then URI Templates are immune to such resource >exhaustion attacks. > >I did find one paper that makes a start at such work, "Enforcing >Strict Model-View Separation in Template Engines", >but the theory is a little weak and it focuses on the nebulous idea of >separation of model and view, as opposed to >a classification of capabilities and limitations. In addition there >seems to not be a lot of work on sub-turing languages, >and most interestingly the contemporary work that is being done is on >Membrane Computing Systems, which >is in turn motivated by studying cell evolutions and chemical >reactions. I am bringing this topic forward in the >hopes of learning of other pointers into the literature, and also >learning if this problem applies to others >in the Apps area, of if I'm all alone with this problem in URI >Templates. - End forwarded message - ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: PROPOSAL: New efficient Unicode string library.
On Wed, Oct 03, 2007 at 12:01:50AM +0200, Twan van Laarhoven <[EMAIL PROTECTED]> wrote a message of 24 lines which said: > Lots of people wrote: > > I want a UTF-8 bikeshed! > > No, I want a UTF-16 bikeshed! Personnally, I want an UTF-32 bikeshed. UTF-16 is as lousy as UTF-8 (for both of them, characters have different sizes, unlike what happens in UTF-32). > What the heck does it matter what encoding the library uses > internally? +1 It can even use a non-standard encoding scheme if it wants. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: getting crazy with character encoding
On Thu, Sep 13, 2007 at 12:23:33AM +, Aaron Denney <[EMAIL PROTECTED]> wrote a message of 76 lines which said: > the characters read and written should correspond to the native > environment notions and encodings. These are, under Unix, > determined by the locale system. Locales, while fine for things like the language of the error messages or the format to use to display the time, are *not* a good solution for things like file names and file contents. Even on a single Unix machine (without networking), there are *several* users. Using the locale to find out the charset used for a file name won't work if these users use different locales. Same thing for file contents. The charset used must be marked in the file (XML...) or in the metadata, somehow. Otherwise, there is no way to exchange files or even to change the locale (if I switch from Latin1 to UTF-8, what do my files become?) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: getting crazy with character encoding
On Wed, Sep 12, 2007 at 04:18:43PM +0200, Andrea Rossato <[EMAIL PROTECTED]> wrote a message of 60 lines which said: > Now, I would expect that the output of a shell command such as > "ls ab*" > would be a string/list of 5 chars. I do not think this expectation is reasonable. I do not think that ls is Unicode-aware. It probably has only bytes semantic, not characters semantic. > I would expect that a file name set in an utf-8 locale should be > read by locale aware application "locale aware application" is too vague. An application can use the locale and still being unable to separate bytes from characters. ls may be "locale aware" but it is probably not "Unicode aware". > l <- fmap lines $ runProcessWithInput "/bin/bash" [] "ls ab*" This is not an Haskell issue but a ls issue. use System.Directory.getDirectoryContents and we'll see. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: What puts False before True?
On Fri, Jun 01, 2007 at 03:33:41AM +0100, PR Stanley <[EMAIL PROTECTED]> wrote a message of 19 lines which said: > The question, however, still remains: why False = 0 and True 1? Arbitrary decision? On a similar case, the ISO 5218 standard, representation of human gender (http://standards.iso.org/ittf/PubliclyAvailableStandards/c036266_ISO_IEC_5218_2004(E_F).zip) says: Data elements Code Not known 0 (zero) Male 1 (one) Female 2 (two) Not applicable 9 (nine) and warns: No significance is to be placed upon the fact that "Male" is coded "1" and "Female" is coded "2". This standard was developed based upon predominant practices of the countries involved and does not convey any meaning of importance, ranking or any other basis that could imply discrimination. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: quiry
On Wed, May 16, 2007 at 06:34:53PM +0530, ashutosh dimri <[EMAIL PROTECTED]> wrote a message of 34 lines which said: > how to convert a hexadecimal into base 10 integer using haskell . I > have written a code but its not working for large values , please > help Not showing the code you wrote will not help. Please read the instructions first: http://www.haskell.org/haskellwiki/Homework_help ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] A new code search engine
http://www.krugle.com/ Unlike Google, you can specify Haskell as a language. But the very useful (and, again, unlike Google) parsing service, which allows you to specify that you search "foldl" only in function calls, not function definitions, seems broken for Haskell ("map" is never found in function calls...) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Currying
On Thu, Jan 18, 2007 at 11:00:26AM +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote a message of 15 lines which said: > what is so great about "currying"? The name is very cool. > What are its uses, apart from letting one define functions with less > parentheses? Partial applications. http://fr.wikipedia.org/wiki/Curryfication ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Draft MissingH Reorg Plan
On Fri, Dec 01, 2006 at 01:30:25PM -0600, John Goerzen <[EMAIL PROTECTED]> wrote a message of 46 lines which said: > This module provides parsers for the grammar defined in RFC2234, > "Augmented BNF for Syntax Specifications: ABNF", Do note that it is an old reference and the RFC on ABNF is 4234, issued one year ago. Also, there is another Parsec-based parser of ABNF in Haskell, Eustathius : http://www.bortzmeyer.org/eustathius-test-grammars.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [ghc 6.6] Where is FGL now?
On Mon, Nov 06, 2006 at 09:37:32PM +0100, Stephane Bortzmeyer <[EMAIL PROTECTED]> wrote a message of 15 lines which said: > In ghc 6.6, it seems it disappeared. OK, sorry for the false alarm, I've found it: http://www.haskell.org/ghc/dist/6.6/ghc-6.6-src-extralibs.tar.bz2 For those who use the Debian packages, you'll need the package libghc6-fgl-dev (which is not yet in Debian "testing", while ghc 6.6 is; so, for Haskell programmers, you may have to choose between "stable" and "unstable" and avoid "testing" for the time being). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [ghc 6.6] Where is FGL now?
In ghc 6.4, I used Data.Graph.Inductive (aka FGL): % ghc-pkg list /usr/lib/ghc-6.4/package.conf: ... fgl-5.2, ... In ghc 6.6, it seems it disappeared. ghc-pkg list does not show it, the compiler says "Could not find module `Data.Graph.Inductive'" but it is still documented in http://www.haskell.org/ghc/docs/latest/html/libraries/index.html and the ghc 6.6 changelog does not mention its removal. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Searching all the source code of the world
http://www.google.com/codesearch A great tool (which fulfills a different need than Hoogle) if you are looking for a concrete example of use of such or such function. Unfortunately, "lang:haskell" is not recognized (as a workaround, "file:\.hs" is OK). This has already been reported: http://groups.google.com/group/Google-Code-Search/browse_thread/thread/8c9ed4b0883f80bf/1afa42009dc3ac46#1afa42009dc3ac46 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [OT] Yet Another program written in Haskell: a language tag parser
The program is written in Haskell, hence my shameless ad here: http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html GaBuZoMeu is a set of programs to parse and check language tags (see the RFC 4646 produced by the IETF Working Group LTRU - Language Tag Registry Update). Language tags are used by several protocols (like HTTP) or languages (like XML) to indicate the human language you want or have. Examples of language tags are "fr" (French), "apa" (Apache), "se-FI" (Swedish, as practiced in Finland) or "uk-Latn" (ukrainian in the latin script). An IANA registry stores the registered values (http://www.iana.org/assignments/language-subtag-registry). A language tag can be well-formed (syntactically correct) or not. This can be tested without access to the registry. A langauge tag can be valid or not (all its subtags registered). This depends on the copy of the registry you use (since the registry changes). GaBuZoMeu includes the following programs: * check-wf checks the well-formedness of tag(s). Example of use: "check-wf fr en-AU". * check-valid checks the validity of tag(s). Same use. GaBuZoMeu is written in Haskell (http://www.haskell.org/) so you'll need an Haskell compiler such as ghc (http://haskell.org/ghc/). To compile, just type "make". To check that everything is OK, you can type "make test". You should get zero "Errors" and zero "Failures". GaBuZoMeu is distributed as free software, under the GNU General Public Licence. Remarks, patches and bug reports are welcome. Written and maintained by Stephane Bortzmeyer <[EMAIL PROTECTED]>. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [OT] A DSL for state machines
Sorry, this is a bit off-topic but I post here because: * it is about a DSL and many Haskellers are fond of DSLs, * the first implementation is written in Haskell. http://www.cosmogol.fr/ describes a proposal to the IETF to standardize the language used for finite state machines (which are common in IETF standards), much like ABNF is standardized in RFC 4234, to describe grammars. The reference implementation, available at http://www.cosmogol.fr/shadok.html is in Haskell. Bug reports, patches, advices, flames, opinions and criticisms are welcome. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Newbied question on IO Monad
On Tue, Sep 12, 2006 at 09:00:19AM -0400, Sara Kenedy <[EMAIL PROTECTED]> wrote a message of 68 lines which said: > Maybe what I talk is not clear. Do not worry, not all the haskell-cafe readers speak english. (I'm french, for instance.) > I want to take the input string sss of "update" to use in: writeFile > "myFile.txt" sss of function "main" and get the value zzz from > "main" to assign for the value return of "update". >From a newbie to another newbie: I do not think it is possible. "There is no way out of the IO monad, once you're in it." See the explanations in the page indicated by Henning Thielemann : http://haskell.org/hawiki/ThatAnnoyingIoType This should work (not tested): update :: String -> IO String update sss = do writeFile "myFile.txt" sss x <- callSystem "myFile.txt" y <- openFile "result.txt" ReadMode zzz <- hGetContents y return zzz main = update "Foobar" ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: does the compiler optimize repeated calls?
On Wed, Sep 06, 2006 at 09:44:05AM -0400, David Roundy <[EMAIL PROTECTED]> wrote a message of 33 lines which said: > Have you even considered the space costs of this? For almost any > non-trivial bit of code I've written, automatic memoization would > result in a completely useless binary, as it almost guarantees > horrific space leaks. And a compile-time option, where the programmer explain which functions should be memoized? ghc -fmemoize=foo,bar darcs.hs ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: does the compiler optimize repeated calls?
On Wed, Sep 06, 2006 at 02:12:28PM +0100, Sebastian Sylvan <[EMAIL PROTECTED]> wrote a message of 36 lines which said: > I think most compilers actually do CSE And automatic memoization? Because common subexpressions can be difficult to recognize but, at run-time, it is much easier to recognize a function call that has already been done. Any common compiler / interpreter which automatically memoizes? In theory, it is also a huge advantage of "pure" functional programming languages. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: does the compiler optimize repeated calls?
[Warnings: newbie and not having tested or read the generated assembly code.] On Wed, Sep 06, 2006 at 09:32:07AM -0300, Alex Queiroz <[EMAIL PROTECTED]> wrote a message of 18 lines which said: >I am a newbie myself (second week of learning Haskell), but I'll > give it a shot: Since functions have no side effects, the compiler > executes the function only once. Sure, "pure" programming languages *allow* the compiler to perform such optimizations but it does not mean it is *actually* done (promises are cheap but writing compiler code is expensive). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: installing modules
On Wed, Sep 06, 2006 at 02:19:14PM +0200, Tamas K Papp <[EMAIL PROTECTED]> wrote a message of 23 lines which said: > Cleanly means that it ends up in the "right" directory. How do > people usually do that? I am using ghc6 on debian testing. Follow the usual cabal routine (everything is in the ghc6 package): cd chart runghc Setup.hs configure runghc Setup.hs build runghc Setup.hs install > Am I supposed to use the thing called "cabal"? Yes and the stuff I quoted above is taken verbatim from the 'chart' page. > Is it perhaps possible to create a debian package from sources that > were packaged with this tool? It si certainly possible but, AFAIK, nobody did it yet. The Debian-Haskell mailing list is probably the good place to ask: http://urchin.earth.li/mailman/listinfo/debian-haskell ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Parsec] No identEnd in ParsecToken?
On Tue, Sep 05, 2006 at 04:17:41PM +0200, Stephane Bortzmeyer <[EMAIL PROTECTED]> wrote a message of 25 lines which said: > I'm trying to use Parsec for a language which have identifiers where > the '-' character is allowed only inside identifiers, not at the > start or the end. [My grammar was underspecified, I also want to disallow two consecutive dashes.] Many thanks to Malcolm Wallace, Chris Kuklewicz and Udo Stenzel for their help and ideas. It seems there is no solution for ParsecToken (so I have to drop it). Among the two solutions which work for me (Malcolm Wallace's and Udo Stenzel's), I choosed the one by Udo because it is the one I understand the best. Here is my final version (rewritten in my style, errors are mine and not Udo's), thanks again: import Text.ParserCombinators.Parsec hiding (spaces) spaces = many1 (char ' ') inner_minus = do char '-' lookAhead alphaNum return '-' identifier = do start <- letter rest <- many (alphaNum <|> try inner_minus) return (start:rest) "identifier" identifiers = do result <- identifier `sepBy` spaces eof return result main = do -- Legal parseTest identifiers "foo bar" parseTest identifiers "foo-bar baz go-to" parseTest identifiers "a b3 c56 e56-y7 gag-3456" -- Illegal parseTest identifiers "1llegal" parseTest identifiers "illegal- more" parseTest identifiers "ill--egal more" parseTest identifiers "illegal -more" ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Parsec] No identEnd in ParsecToken?
On Tue, Sep 05, 2006 at 03:46:16PM +0100, Chris Kuklewicz <[EMAIL PROTECTED]> wrote a message of 69 lines which said: > Fixing this may be as simple as > > > identifier = try $ do > > start <- letter > > rest <- many (alphaNum <|> char '-') > > end <- letter > > return ([start] ++ rest ++ [end]) > >"characters authorized for identifiers" It does not work for me (and neither does the second). The "try" argument always fails, probably because the term "many" on the "rest" line is greedy and swallows the ending letter. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [Parsec] No identEnd in ParsecToken?
I'm trying to use Parsec for a language which have identifiers where the '-' character is allowed only inside identifiers, not at the start or the end. ParsecToken has identStart to tell that the '-' is not allowed at the start but I find no equivalent identEnd? I tried also to express the same rule with ordinary combinators, without ParsecToken but this fails: identifier = do start <- letter rest <- many (alphaNum <|> char '-') end <- letter return ([start] ++ rest ++ [end]) "characters authorized for identifiers" because the parser created by "many" is greedy: it consumes everything, including the final letter. Any idea? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [JOKE] Foozles: anatomy of a programming language fad
http://hope.cs.rice.edu/twiki/pub/WG211/M3Schedule/foozles.pdf I hope many Haskellers will have laugh here :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Parsec] A combinator to match between M and N times?
On Tue, Aug 29, 2006 at 03:11:09PM +0200, Tomasz Zielonka <[EMAIL PROTECTED]> wrote a message of 28 lines which said: > How about this? It works fine, many thanks. Here is the version rewritten according to my taste: import Text.ParserCombinators.Parsec import Data.Maybe (catMaybes) countBetween m n p | n < m = error "First bound must be lower or equal than second bound" | otherwise = do xs <- count m p ys <- count (n - m) ((option Nothing) (do y <- p return (Just y))) return (xs ++ catMaybes ys) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [Parsec] A combinator to match between M and N times?
Parsec provides "count n p" to run the parser p exactly n times. I'm looking for a combinator "countBetween m n p" which will run the parser between m and n times. It does not exist in Parsec. Much to my surprise, it seems quite difficult to write it myself and, until now, I failed (the best result I had was with the "option" combinator, which unfortunately requires a dummy value, returned when the parser fails). Does anyone has a solution? Preferrably one I can understand, which means not yet with liftM :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Can Your Programming Language Do This?
On Wed, Aug 02, 2006 at 01:02:20PM -0700, Reilly Hayes <[EMAIL PROTECTED]> wrote a message of 133 lines which said: > My guess is that most of the people who participate on this list are > in some sort of research center, where the value of academic > research is a given. As someone who does not work in a research center, and who tries to use Haskell for practical problems, I can say that I have mixed feelings about haskell-cafe: 1) My newbie questions always receive a timely answer, the answer is correct and the tone of the reply is friendly without any sign of patronization against the beginner. (Same thing on #haskell, so it is a good opportunity to thank everybody.) 2) The typical discussion and the typical subjects are very far from the ordinary programmer. If he or she reads the archives of the list before commiting herself or himself to Haskell, he or she might be scared. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Can Your Programming Language Do This?
On Wed, Aug 02, 2006 at 11:14:30AM -0700, Jared Updike <[EMAIL PROTECTED]> wrote a message of 32 lines which said: > (Sorry, couldn't find a place to comment on Joel's blog). http://discuss.joelonsoftware.com/?joel And I agree with Reilly Hayes: as I said in my first message, Joel tried to introduce ordinary programmers (not computer-science teachers) to functional programming. Such propaganda work is extremely useful and experts in monads or type inference may not be the best people to do so. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Can Your Programming Language Do This?
>From the excellent programming blog "Joel on software", a very good text if you need to convince Java or C programmers that functional programming is a A Good Thing. Probably all the readers of this list will find it brings nothing new (that's perfectly right) but it is oriented towards ordinary programmers :-) http://www.joelonsoftware.com/items/2006/08/01.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Parsec] Backtracking with try does not work for me?
On Tue, Aug 01, 2006 at 09:41:40AM +0100, Chris Kuklewicz <[EMAIL PROTECTED]> wrote a message of 105 lines which said: > The problem is mentioned here: > > http://www.cs.uu.nl/people/daan/download/parsec/parsec.html#notFollowedBy notFollowedBy seems to work for me and is quite simple, even for my brain. Thanks. > The first would be to test whether "bb" is followed by "eof" or > "comma" before accepting it. notFollowedBy actually does the opposite (checking that there are no more letters). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] A program which never crashes (even when a function calls "error")
[It is a philosophical question, not a practical programming problem.] I'm used, in imperative programming languages with exceptions (like Python) to call any function without fear of stopping the program because I can always catch the exceptions with things like (Python): while not over: try: code which may raise an exception... except Exception e: do something clever How to do it in Haskell? How can I call functions like Prelude.head while being sure my program won't stop, even if I call head on an empty list (thus calling "error")? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Parsec] Backtracking with try does not work for me?
On Mon, Jul 31, 2006 at 06:51:27PM +0100, Chris Kuklewicz <[EMAIL PROTECTED]> wrote a message of 102 lines which said: >minilang = do > char 'a' > optional (try (do {comma ; char 'b'})) > optional (do {comma ; char 'c'}) > eof > return "OK" I now have a new problem which was hidden beneath. If the language authorizes "a,bb" and "a,bbc", "a,bbc" is not accepted by my parser since it already accepted "a,bb" and the "c" which is left triggers a syntax error. This time, "try" believes it succeeded but should not. I need more look-ahead but I'm not sure how? (Again, I do not control the language so I cannot make it more deterministic.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Parsec] Backtracking with try does not work for me?
On Mon, Jul 31, 2006 at 12:57:04PM +0200, Udo Stenzel <[EMAIL PROTECTED]> wrote a message of 59 lines which said: > Now 'optional x' always succeeds, so the 'try' is useless where you > placed it. You need to 'try' the argument to 'optional': It works, too. Many thanks for the code and the explanation. > You could also factor your grammar It is a language I do not control, so I prefer to keep the grammar as close as possible from the official specification. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Parsec] Backtracking with try does not work for me?
On Mon, Jul 31, 2006 at 10:59:14AM +0200, Matthias Fischmann <[EMAIL PROTECTED]> wrote a message of 89 lines which said: >try b <|> (return '-') ... > The (return 'x') is needed for type consistency. OK, it works. Many thanks for the solution and the explanations. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [Parsec] Backtracking with try does not work for me?
I'm trying to write a Parsec parser for a language which authorizes (this is a simplified example) "a" or "a,b,c" or "a,c" or "a,b". (I can change the grammar but not the language.) The first attempt was: * CUT HERE import Text.ParserCombinators.Parsec import System (getArgs) comma = char ',' minilang = do char 'a' optional (do {comma ; char 'b'}) optional (do {comma ; char 'c'}) eof return "OK" run parser input = case (parse parser "" input) of Left err -> putStr ("parse error at " ++ (show err) ++ "\n") Right x -> putStr (x ++ "\n") main = do args <- getArgs run minilang (head args) * CUT HERE Of course, it fails for "a,c": parse error at (line 1, column 3): unexpected "c" expecting "b" for a reason explained in Parsec's documentation (the parser "optional (do {comma ; char 'b'})" already consumed the input, do note the column number). What puzzles me is that the solution suggested in Parsec's documentation does not work either: * CUT HERE *** minilang = do char 'a' try (optional (do {comma ; char 'b'})) optional (do {comma ; char 'c'}) eof return "OK" * CUT HERE *** parse error at (line 1, column 2): unexpected "c" expecting "b" Apparently, "try" was used (do note that the column number indicates that there was backtracking) but the parser still fails for "a,c". Why? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [FGL] Works on ghc, not on Hugs?
[Warning: beginner with FGL, the Functional Graph Library.] My first program with Data.Graph.Inductive works fine on ghc but raises a type error with hugs, which strikes me as odd. % hugs -98 smalltest.hs __ __ __ __ ___ _ || || || || || || ||__ Hugs 98: Based on the Haskell 98 standard ||___|| ||__|| ||__|| __|| Copyright (c) 1994-2005 ||---|| ___|| World Wide Web: http://haskell.org/hugs || || Report bugs to: hugs-bugs@haskell.org || || Version: 20050308 _ Hugs mode: Restart with command line option +98 for Haskell 98 mode ERROR "smalltest.hs":7 - Type error in application *** Expression : mkGraph mynodes myedges *** Term : myedges *** Type : [(Integer,Integer,[Char])] *** Does not match : [LEdge [Char]] ghc works: % ghc --make smalltest.hs Chasing modules from: smalltest.hs Compiling Main ( smalltest.hs, smalltest.o ) Linking ... % ./a.out 0:"Toto"->[("Couic",1),("Crac",2)] 1:"Tata"->[] 2:"Shadok"->[] 3:"Machin"->[] Here is the code: import Data.Graph.Inductive mynodes = [(0, "Toto"), (1, "Tata"), (2, "Shadok"), (3, "Machin")] myedges = [(0, 1, "Couic"), (0, 2, "Crac")] graph :: Gr String String graph = mkGraph mynodes myedges main = do print graph ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANN: System.FilePath 0.9
On Mon, Jul 17, 2006 at 03:07:51AM +0100, Neil Mitchell <[EMAIL PROTECTED]> wrote a message of 64 lines which said: > I am specificially concentrating on type FilePath = String, because > that is how it is defined by Haskell 98. And if someone wants to define a "new" and "better" FilePath type, I would prefer something more abstract, such as a list of Path components, with functions to serialize it as a String and to parse it from a String. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANN: System.FilePath 0.9
On Mon, Jul 17, 2006 at 03:07:51AM +0100, Neil Mitchell <[EMAIL PROTECTED]> wrote a message of 64 lines which said: > How about adding something like "restrictFilePaths :: FilePath -> IO > ()" which will restrict the area that can be played with to that > beneath the given FilePath? If someone does so, be aware that it is *not* trivial to write it securely. For instance, many lazy (not in the Haskell meaning) programmers believe that the path is safe if it does not include .. but it is false (hint: ."."/foo/bar is a legal path on Unix). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Interest in helping w/ Haskell standard
On Fri, Oct 14, 2005 at 03:34:33PM +0100, Jon Fairbairn <[EMAIL PROTECTED]> wrote a message of 37 lines which said: > > Because the language used inside these strings is standard, > > multi-language, widely used and documented? > > 10,000 lemmings can't be wrong? Right, disregard ASCII and specify the lexemes of Haskell 2 in a new encoding scheme, much better than ASCII :-) > Not even the syntax of such regexps is checked at compile time. Of course, from the compiler's PoV, they are just strings. May be a new form of strings, like in Perl, to show that this is a regexp? > Since Unicode is increasingly adopted, we could just use «regexp» The Unicode standard for regexps, UTR #18 (http://www.unicode.org/reports/tr18/) uses the very same standard syntax that you criticize. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Interest in helping w/ Haskell standard
On Fri, Oct 14, 2005 at 04:20:24PM +0200, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote a message of 23 lines which said: > alpha = ('A' `to` 'Z') ||| ('a' `to` 'z') If you intend to seriously specify a new language for regexps, please consider Unicode. There are more letters than A to Z... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Interest in helping w/ Haskell standard
On Fri, Oct 14, 2005 at 04:20:24PM +0200, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote a message of 23 lines which said: > By the way, it should be possible to handle regular expressions in > an Haskell-like way. If you like so, but as one more possibility, not as the only way. > I always couldn't understand why one has to write regular > expressions as strings Because the language used inside these strings is standard, multi-language, widely used and documented? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Interest in helping w/ Haskell standard
On Thu, Oct 13, 2005 at 11:29:57AM +, Robin Green <[EMAIL PROTECTED]> wrote a message of 22 lines which said: > ... and, in the case of the Standard Prelude section, or equivalent, > a specification of well-understood functions that the spec authors > agree "should" be provided in all implementations. ... (It is, > however, one of the "must haves" for Haskell to be considered for > use in production systems.) Regexps and XML are, IMHO, also "must haves". ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Interest in helping w/ Haskell standard
On Wed, Oct 12, 2005 at 03:39:34PM -0700, Isaac Jones <[EMAIL PROTECTED]> wrote a message of 30 lines which said: > One of the main topics was the perceived need of a new standard, As someone who is not an academic researcher and not a student in CS, I would like to express a personal opinion; we don't need a new standard. To me, Haskell needs more libraries, more users (which means more debugging and more documentations), more implementations, of course more real applications (darcs did a lot of the success of Haskell), so we can read their code, push sysadmins to install Haskell, etc. Most functional programming languages have been killed by the "CS effect": the fact that most users are more interested in exploring new areas of computer science than in producing code. Lisp and ML were killed by the explosion of many different and incompatible versions. I am not interested in Haskell++ or OOHaskell or anything like that. If people want to standardize things, their time could be, IMHO, best spent by standardizing libraries (I just recently discovered that Text.Regex is not standard and my programs do not run under hugs). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ghc for sunos
On Thu, Sep 08, 2005 at 01:36:30PM -0700, Brian McQueen <[EMAIL PROTECTED]> wrote a message of 6 lines which said: > I'm surrounded by Sun boxes here. One solution is to install Debian/GNU Linux on these, ghc runs fine on it :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe