Re: [Haskell-cafe] [ANN] Haskell-Paris meetup
I'm afraid I won't attend the event, but I have to say that you have one of the very best Haskell logos I've ever seen :) 2013/6/4 lucas di cioccio lucas.dicioc...@gmail.com Dear all, I'm happy to announce that the Haskell-Paris group will meet on June 25th in Paris. Please register (free) at http://www.meetup.com/haskell-paris/events/122515522/ . Program is not decided yet (contributions are welcome). We'll update once we know the lineup. I don't like to send spammy emails but I would like to take advantage of this announcement to invite any non-Parisian Haskellers to get in touch with us (email, twitter, or meetup page) if you are in town. We may an event scheduled close in time and we can anyway propose a get-together in a restaurant so that visitors can taste our great fooddrink and everyone can chat about her favorite programming language. I did this type of semi-planned dinners a few times with some Ruby folks and it's a good way to build ties :). Regards, --Lucas DiCioccio ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The state of binary (de)serialization
Hey guys, I didn't see this thread at first, thanks to Johan for bringing it to my attention. cereal is a fork of binary, and provided a incremental interface before binary did. It also has a few additional combinators like isolate and label, which is the reason why safecopy uses cereal instead of binary (at least I know it uses label). As an experiment, I've wrapped the api of Data.ByteString.Builder and and re-exported it as Data.Binary.Builder, but it turned out that performance got worse. I have yet to look into why. Once it all seems ok, binary will just wrap and re-export bytestrings builder. If you use binary or builder doesn't really matter, the basic APIs are very similar. builder can offer some more options if you want to spend more time in tuning for speed. binary is also already in the HP, since it is bundled with GHC (GHC depends on binary). In other words, depending on binary should be future-proof. On another note, binary-0.7 is out, get it while it's hot! :) Lennart 2013/2/26 Johan Tibell johan.tib...@gmail.com On Mon, Feb 25, 2013 at 4:51 PM, Alexander Solla alex.so...@gmail.comwrote: On Mon, Feb 25, 2013 at 11:59 AM, Johan Tibell johan.tib...@gmail.comwrote: There are some blog posts and comments out there about merging cereal and binary, is this what's the goal/going on (cfr runGetIncremental)? It's most definitely the goal and it's basically done. The only thing I don't think we'll adopt from cereal is the instances from container types. Why not? Those instances are useful. Without instances defined in binary/cereal, pretty much every Happstack (or, better said, every ixset/acidstate/safecopy stack) user will have to have orphan instances. I will have to give a bit more context to answer this one. After the binary package was created we've realized that it should really have been two packages: * One package for serialization and deserialization of basic types, that have a well-defined serialization format even outside the package e.g. little and big endian integers, IEEE floats, etc. This package would correspond to Data.Binary.Get, Data.Binary.Builder, and Data.Binary.Put. * One package that defines a particular binary format useful for serializing arbitrary Haskell values. This package would correspond to Data.Binary. For the latter we need to decide what guarantees we make. For example, is the format stable between releases? Is the format public (such that other libraries can parse the output of binary)? Right now these two questions are left unanswered in both binary and cereal, making those packages less useful. Before we answer those questions we don't want to 1) add more dependencies to binary and 2) define serialization formats that we might break in the next release. So perhaps once we've settled these issues we'll include instances for containers. Also, cereal has a generic instance. Will the new binary? That sounds reasonable. If someone sends a pull request Lennart or I will review and merge it. -- Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Happstack 7
On Friday, 30 March 2012 00:53:48 UTC+4, Jeremy Shaw wrote: We are pleased to announce the release of Happstack 7! Happstack is a fast, modern, web application framework written in Haskell. Please check out the brand new happstack.com website to read about what is new in Happstack 7, and what we are planning for Happstack 8, and what makes Happstack great! http://www.happstack.com/ - jeremy Congratulations to the new release, and may I say that the homepage looks smashing! :D With the work of Antoine Latter's happstack-wai (https://github.com/aslatter/happstack-wai), it's likely possible to serve happstack applications through my (still in development) SPDY WAI server ( https://github.com/kolmodin/spdy) although I have not tested this combination yet. Before I saw happstack-wai I had a quick look at the happstack API and saw that the Request keeps the request body as a (lazy?) String. I'm curious to the rationale for this, as one could expect a lazy bytestring would be more efficient, and some kind of stream would better support error handling (given that the String is indeed lazy). Sorry if this has been discussed before, I searched the mailing list without finding anything. Feels like Happstack has been reborn, thanks again! Cheers, Lennart ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Data.Binary.IncrementalGet remake
Hi, On Wed, Apr 20, 2011 at 8:35 PM, Antoine Latter aslat...@gmail.com wrote: On Wed, Apr 20, 2011 at 1:03 PM, Sergey Mironov ier...@gmail.com wrote: Hello cafe. Haskell wiki told me about continuation-based parser Data.Binary.IncrementalGet [1] from binary-strict package. I found the idea very useful and tried to use it. Original library by Lennart Kolmodin raises some questions. The lib's main data structures are: Lennart Kolmodin has a branch of Binary with incremental get which supports lookAhead: https://github.com/kolmodin/binary/tree/cps Thanks Antonine for noting this. I don't have performance measurements, but if you look-ahead too far it obviously isn't good for memory consumption. Indeed you trade off memory consumption if you're not careful with lookAhead, as you would do with any depth-first parser allowing choice. Although I haven't benchmarked, I think it has a more memory efficient implementation than the increasingly popular text parsing library attoparsec (foundation of haskell's fastest json library, aeson). Antoine data IResult a = IFailed S String | IFinished S a | IPartial (B.ByteString - IResult a) newtype Get r a = Get { unGet :: S - (a - S - IResult r) - IResult r } instance Monad (Get r) where return a = Get (\s - \k - k a s) m = k = Get (\s - \cont - unGet m s (\a - \s' - unGet (k a) s' cont)) fail err = Get (\s - const $ IFailed s err) Here, S is parser's state. It works well, but currently doesn't support lookAhead. I tried to add such function and gave up to do it having current implementation, but write simpler one instead. Please see IncrementalGet2.hs (link [2] below). Remake is briefly tested, has no ghc-specific optimizations, but allows user to peek data from stream. What bothering me is the fact that I could actually miss idea (or part of idea) of the original. If it is so, please let me know :) For example, what is the point of using separate result type r in original Get r a? In the case of parsing with binary, I don't think there are any serious limitations with not being able to specify your own r in Get r a. I ran into something during the implementation, but I'm afraid it wasn't noteworthy enough to remember :) Possibly it had to do something with saving continuations for later use, and how flexible you could be when using them? Hmm.. Anyway, not a problem in binary. Work has been done lately by Johan Tibell to make the builder (part of the Put monad) efficient, and with very good progress. I've worked on the CPS based parsing. Our aim is to provide the easiest to use, and at the same time, the fastest, binary parsing library out there. Expect much internal change, yet backwards compatibility, with the next release :) Unfortunately I've been extremely busy lately, so don't expect a release for a few more months. I invite everybody to try out the new code and try to benchmark and break it :) Cheers, Lennart Kolmodin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: ANNOUNCE: GHC 6.10.2 Release Candidate 1
Ian Lynagh wrote: We are pleased to announce the first release candidate for GHC 6.10.2: http://www.haskell.org/ghc/dist/6.10.2-rc1/ This includes two source bundles: ghc-6.10.1.20090314-src.tar.bz2 ghc-6.10.1.20090314-src-extralibs.tar.bz2 Awesome! This release candidate is also available for testing purposes through the gentoo haskell overlay. http://code.haskell.org/gentoo/gentoo-haskell/ You can use the overlay either through layman (overlay called haskell) http://www.gentoo.org/proj/en/overlays/userguide.xml or by yourself a la old school, PORTDIR_OVERLAY in make.conf. We don't yet have any ebuilds for the extralibs. GHC is hard masked, meaning only available for testing purposes, use caution :) $ echo dev-lang/ghc /etc/portage/package.unmask It's also keyworded ~amd64 ~x86, meaning you'll have to allow potentially unstable packages: $ echo dev-lang/ghc /etc/portage/package.keywords Last but not least, the ebuild does not provide any bootstrapping binary to compile ghc, so you need to already have a version of ghc installed to bootstrap with. Then emerge with $ USE=ghcbootstrap -binary emerge dev-lang/ghc Please report any issues in #gentoo-haskell @ freenode. Cheers, Lennart Kolmodin -- Gentoo Dev ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: ANNOUNCE: GHC version 6.10.1
Hello fellow GHC users, Ian Lynagh wrote: == The (Interactive) Glasgow Haskell Compiler -- version 6.10.1 == [snip] How to get it ~ The easy way is to go to the web page, which should be self-explanatory: http://www.haskell.org/ghc/ Gentoo Linux users can get it from the gentoo-haskell overlay[1]. If you're not familiar with this overlay (a gold mine for haskell hackers using gentoo), you can easily use layman[2] to get access. Make sure you have darcs installed, as it is a requirement for our overlay. Once layman is set up, add the overlay with: $ layman -a haskell Note that ghc-6.10.1 still is masked by keyword, and you need to unmask it first. If you're not familiar with how to do this, here's a quick guide: # make sure /etc/portage exists $ [[ -d /etc/portage ]] || mkdir /etc/portage # accept ghc being ~arch $ echo dev-lang/ghc /etc/portage/package.keywords # ghc requires the very latest libedit package $ echo dev-libs/libedit /etc/portage/package.keywords You may then install ghc-6.10.1 by saying: # this requires that you already have an older ghc version installed $ USE=ghcbootstrap -binary emerge ghc The USE flags are required as we don't just yet provide the required binaries to bootstrap ghc. The command above requires that you already have a ghc version installed to bootstrap with. This version will be replaced with ghc-6.10.1 once the installation finishes. GHC binaries will follow shortly, which will shorten the procedure to: $ emerge ghc The packages from extralibs will also be available from the overlay. If you run into trouble, reply to the ml, or find us in #gentoo-haskell at freenode. Cheers, Lennart Kolmodin -- using his Gentoo Linux Developer hat [1] http://code.haskell.org/gentoo/gentoo-haskell/ [2] http://www.gentoo.org/proj/en/overlays/userguide.xml ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell] Re: ANNOUNCE: GHC version 6.10.1
Hello fellow GHC users, Ian Lynagh wrote: == The (Interactive) Glasgow Haskell Compiler -- version 6.10.1 == [snip] How to get it ~ The easy way is to go to the web page, which should be self-explanatory: http://www.haskell.org/ghc/ Gentoo Linux users can get it from the gentoo-haskell overlay[1]. If you're not familiar with this overlay (a gold mine for haskell hackers using gentoo), you can easily use layman[2] to get access. Make sure you have darcs installed, as it is a requirement for our overlay. Once layman is set up, add the overlay with: $ layman -a haskell Note that ghc-6.10.1 still is masked by keyword, and you need to unmask it first. If you're not familiar with how to do this, here's a quick guide: # make sure /etc/portage exists $ [[ -d /etc/portage ]] || mkdir /etc/portage # accept ghc being ~arch $ echo dev-lang/ghc /etc/portage/package.keywords # ghc requires the very latest libedit package $ echo dev-libs/libedit /etc/portage/package.keywords You may then install ghc-6.10.1 by saying: # this requires that you already have an older ghc version installed $ USE=ghcbootstrap -binary emerge ghc The USE flags are required as we don't just yet provide the required binaries to bootstrap ghc. The command above requires that you already have a ghc version installed to bootstrap with. This version will be replaced with ghc-6.10.1 once the installation finishes. GHC binaries will follow shortly, which will shorten the procedure to: $ emerge ghc The packages from extralibs will also be available from the overlay. If you run into trouble, reply to the ml, or find us in #gentoo-haskell at freenode. Cheers, Lennart Kolmodin -- using his Gentoo Linux Developer hat [1] http://code.haskell.org/gentoo/gentoo-haskell/ [2] http://www.gentoo.org/proj/en/overlays/userguide.xml ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: ANNOUNCE: GHC 6.10.1 RC 1
Anatoly Yakovenko wrote: I am using the gentoo package for 6.10.1 and when i start ghci it tries to allocate over 1gb of memory, which hits my ulimit. Is anyone else getting absurd memory usage when trying to start ghci? $ ghci GHCi, version 6.10.0.20081007: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. ghc: out of memory (requested 1048576 bytes Likely the same bug we've seen before with libedit, or related; GHC bug reported at http://hackage.haskell.org/trac/ghc/ticket/2716 (closed as invalid as the problem isn't with GHC) Gentoo bug report at http://bugs.gentoo.org/237882 to fix gentoo's libedit. You can try to apply the patch in the gentoo bug locally and see if that resolves the issue. Cheers, Lennart K ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: ANNOUNCE: GHC 6.10.1 RC 1
Ian Lynagh wrote: We are pleased to announce that the GHC 6.10.0.20081007 snapshot is the first release candidate for GHC 6.10.1. You can download the release candidate from here: http://www.haskell.org/ghc/dist/stable/dist/6.10.1-rc-1/rc.html This page includes: * a Windows installer * an OS X installer * bindists for amd64/Linux and ix86/Linux * the sources It's also available in Gentoo Linux, hard masked. If you're not already familiar with the Gentoo Haskell overlay, use layman[1] to get the haskell overlay and unmask[2] the packages dev-lang/ghc and dev-haskell/cabal. Then, simply: $ emerge ghc Cheers, Lennart Kolmodin [1] http://www.gentoo.org/proj/en/overlays/userguide.xml [2] http://gentoo-wiki.com/Masked#Hard_Masked ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] announcing darcs 2.1.0pre3
Eric Kow wrote: The third pre-release of darcs 2.1 is now available at http://darcs.net/darcs-2.1.0pre3.tar.gz darcs 2.1.0pre3 is now available in Gentoo Linux, hard masked. Update your portage tree and unmask[1] it. Cheers, Lennart Kolmodin [1] http://gentoo-wiki.com/Masked#Hard_Masked ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] announcing darcs 2.1.0pre2
Eric Kow wrote: The second pre-release of darcs 2.1 (formerly known as 2.0.3) is now available at http://darcs.net/darcs-2.1.0pre2.tar.gz darcs 2.1.0pre2 is now available in Gentoo Linux, hard masked. Update your portage tree and unmask[1] it. Cheers, Lennart Kolmodin [1] http://gentoo-wiki.com/Masked#Hard_Masked ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: [xmonad] ANNOUNCE: xmonad 0.8 released!
Don Stewart wrote: nomeata: Hi, Am Freitag, den 05.09.2008, 18:38 -0700 schrieb Don Stewart: xmonad packages are available in the package systems of at least: Debian, Gentoo, Arch, Ubuntu, OpenBSD, NetBSD, FreeBSD, Gobo, NixOS, Source Mage, Slackware and 0.8 packages will appear in coming days (some are already available). Debian xmonad and xmonad-contrib package uploaded (although xmonad-contrib is in the two-day delayed queue, to give autobuilders a chance to build xmonad first). Great work, Joachim! Thanks for being so responsive on this. Go Debian! Committed to Gentoo Linux earlier this evening. http://packages.gentoo.org/package/x11-wm/xmonad http://packages.gentoo.org/package/x11-wm/xmonad-contrib Cheers, Lennart K ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: [xmonad] ANNOUNCE: xmonad 0.8 released!
Don Stewart wrote: kolmodin: Don Stewart wrote: nomeata: Hi, Debian xmonad and xmonad-contrib package uploaded (although xmonad-contrib is in the two-day delayed queue, to give autobuilders a chance to build xmonad first). Great work, Joachim! Thanks for being so responsive on this. Go Debian! Committed to Gentoo Linux earlier this evening. http://packages.gentoo.org/package/x11-wm/xmonad http://packages.gentoo.org/package/x11-wm/xmonad-contrib Gentoo steps up! Excellent work guys. And if I read those graphs correctly, that's xmonad on hppa and sparc too? Yep, that's right. Our arch teams has tested an earlier version, thus it's available for this version too since it doesn't introduce any major changes in dependencies or build procedure. Although probably no one has yet build it using our ebuild for this version, we're confident it'll work ;) I'm pleased with upgrading and switching to avoidStruts without even having to log out, well done :) Cheers, Lennart K ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Gtk2hs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew Coppin wrote: | Just a short one... gtk2hs won't build on my [Linux] laptop. What's the | best channel for seeking help with this? The #haskell (on freenode) isn't bad. You'll probably get help pretty quick here, it's known to be very user friendly. The subset #gentoo-haskell is good too, especially if you're using Gentoo Linux. You'll find both me and one of the gkt2hs maintainers (dcoutts) in both channels. Gtk2Hs also has mailing lists, see http://www.haskell.org/gtk2hs/development/ Note that there is pretty much the same people you're talking to no matter which method you pick :) Or... we can just continue here.. Which version of ghc and gtk2hs? Did you get an error message? Cheers, ~ Lennart Kolmodin -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH2uAT4txYG4KUCuERAjCrAKCC4HMw0b5vuhLxKhm5jyUIIB8ybACdFenO EqXbl/H8xpdjqMDimfbgpes= =5Du+ -END PGP SIGNATURE- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell] ANNOUNCE: binary 0.3 - bigger, better, faster
Greetings friends! I'm pleased to announce binary 0.3! The 'binary' package provides efficient serialization of Haskell values to and from lazy ByteStrings. ByteStrings constructed this way may then be written to disk, written to the network, or further processed (e.g. stored in memory directly, or compressed in memory with zlib or bzlib). In total 14 people have contributed code and many more given feedback and cheerleading on [EMAIL PROTECTED] Thanks to all of you! It's available through Hackage: tarball: http://hackage.haskell.org/packages/archive/binary/binary-0.3.tar.gz darcs:darcs get http://darcs.haskell.org/binary homepage: http://www.cse.unsw.edu.au/~dons/binary.html It's been a while since the last release of binary [1] the 25th of January earlier this year. Lets have a look of what's changed since then: API additions - The first thing you're going to notice that differs is the polished API. Being used by more people now than it was in January, we've added features that where missing before. More functions has been added to the Get/Put monads giving information over bytes read, remaining bytes etc for whenever you need to do custom serialization. You can now also read and write words in host endian order. Instances has been added to handle Double, Float and Ratio. Performance --- Decoding speed has been tuned by a rewrite and is currently about half the speed of the lightning fast encoding. Don't hesitate to give feedback on #haskell or by mail, we've always got time for a chat :) The Binary Strike Force, Lennart Kolmodin Duncan Coutts Don Stewart Spencer Janssen David Himmelstrup Björn Bringert Ross Paterson Einar Karttunen John Meacham Ulf Norell Tomasz Zielonka Stefan Karrmann Bryan O'Sullivan Florian Weimer [1] http://article.gmane.org/gmane.comp.lang.haskell.general/14800 -- The only thing that interferes with my learning is my education. -- Albert Einstein ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
[Haskell-cafe] ANNOUNCE: binary 0.3 - bigger, better, faster
Greetings friends! I'm pleased to announce binary 0.3! The 'binary' package provides efficient serialization of Haskell values to and from lazy ByteStrings. ByteStrings constructed this way may then be written to disk, written to the network, or further processed (e.g. stored in memory directly, or compressed in memory with zlib or bzlib). In total 14 people have contributed code and many more given feedback and cheerleading on [EMAIL PROTECTED] Thanks to all of you! It's available through Hackage: tarball: http://hackage.haskell.org/packages/archive/binary/binary-0.3.tar.gz darcs:darcs get http://darcs.haskell.org/binary homepage: http://www.cse.unsw.edu.au/~dons/binary.html It's been a while since the last release of binary [1] the 25th of January earlier this year. Lets have a look of what's changed since then: API additions - The first thing you're going to notice that differs is the polished API. Being used by more people now than it was in January, we've added features that where missing before. More functions has been added to the Get/Put monads giving information over bytes read, remaining bytes etc for whenever you need to do custom serialization. You can now also read and write words in host endian order. Instances has been added to handle Double, Float and Ratio. Performance --- Decoding speed has been tuned by a rewrite and is currently about half the speed of the lightning fast encoding. Don't hesitate to give feedback on #haskell or by mail, we've always got time for a chat :) The Binary Strike Force, Lennart Kolmodin Duncan Coutts Don Stewart Spencer Janssen David Himmelstrup Björn Bringert Ross Paterson Einar Karttunen John Meacham Ulf Norell Tomasz Zielonka Stefan Karrmann Bryan O'Sullivan Florian Weimer [1] http://article.gmane.org/gmane.comp.lang.haskell.general/14800 -- The only thing that interferes with my learning is my education. -- Albert Einstein ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell] -compiler-options vs {#-LANGUAGE Flags-#}
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 S. Alexander Jacobson wrote: I think the LANGUAGE pragma is better than the OPTIONS_GHC pragma but I am relatively indifferent on that issue. My only point is that module authors should put this information in the module source rather than in the build system. I think the LANGUAGE pragma is much better than OPTIONS_GHC, for several reasons. * It's compiler independent. * It's clear that you're only adding extensions, not any random compiler flag. * It plays nicely with Ian's proposal on http://article.gmane.org/gmane.comp.lang.haskell.cabal.devel/464 Alexander, I've added LANGUAGE pragmas to binary, let me know how it works out for you. Cheers, Lennart Kolmodin -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGBRcW4txYG4KUCuERAq2qAJ9Cd//bRv53Q+pr3Sab5r7JE4CSIgCgnAzG FgLR4dBZkCTmecN8R9IrpYI= =iqeA -END PGP SIGNATURE- ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: hasktags - small patch
Marc Weber wrote: Without really knowing in which context this function is going to be HaskTags.hs from ghc distribution. Mm, yes. I meant I was to lazy to check which results are appropriate :) K ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: hasktags - small patch
Marc Weber wrote: This small patch introduces a now mywords function which recognizes a::b as words a,::,b which is what we need here (?) It does work in the above example. Here is the diff. Is it worth applying? 154c154 let wordlines = map words aslines --- let wordlines = map mywords aslines 161a162,174 -- my words is mainly copied from Data.List. -- difference abc::def is split into three words instead of one. mywords :: String - [String] mywords (':':':':xs) = :: : mywords xs mywords s = case dropWhile {-partain:Char.-}isSpace s of - [] s' - w : mywords s'' where (w, s'') = myBreak s' myBreak [] = ([],[]) myBreak (':':':':xs) = ([], ::++xs) myBreak (' ':xs) = ([],xs); myBreak (x:xs) = let (a,b) = myBreak xs in (x:a,b) Without really knowing in which context this function is going to be used, expected results and so on, I've cooked up another alternative. Naturally it's possible to remove the spaces too if it's really required. let wordlines = map (groupBy (\a b - isVarChar a == isVarChar b)) aslines isVarChar x = any ($ x) [isDigit, isAlpha, (== '_'), (== '\'')] It parses data LogInController = LogInController {rLoggedIn::R Bool, rwUserName::RWE String, rwPasswd::RWE String} as [data, ,LogInController, = ,LogInController, {,rLoggedIn,::,R, ,Bool,, ,rwUserName,::,RWE, ,String,, ,rwPasswd,::,RWE, ,String,}] Cheers, Lennart K ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] LugRadio talk
Dougal Stanton wrote: So which one of you wonderful people volunteered to give a talk on Haskell at the coming LugRadio Live? I'm afraid I didn't catch the name, though it might have been a Magnus something? It might be enough to make me go if I knew there would be some funky Haskelling going on. I heard it as Magnus too, a Swedish name. Sounds interesting indeed, LugRadio Live 2007, 7th-8th July 2007, The Lighthouse, Fryer Street, Wolverhampton, UK. Cheers, Lennart Kolmodin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell] Re: state of HaXml?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wagner Ferenc wrote: [EMAIL PROTECTED] (Norman Ramsey) writes: load :: String - IO X.Document load fn = do handle - IO.openFile fn IO.ReadMode contents - IO.hGetContents handle IO.hClose handle return $ XP.xmlParse fn contents Try not closing the handle before parsing. I think it's a little more to it than that. The parsing is performed lazily and therefore it's hard to try to close the handle manually, even if HaXml would parse all of the file at once (unless you force the evaluation). The simplest thing is to use readFile (from the Prelude) instead of using handles. readFile will take care of everything for you when the time is right. load fn = do contents - readFile fn return $ XP.xmlParse fn contents That's it! Cheers, Lennart Kolmodin -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFljzs4txYG4KUCuERAuqkAJ9sBHWqo8cViDoqiYIGaBmBQ2/mngCgiZxG HJT4vGCs/LT/aA6hsjMfYgc= =EoQ5 -END PGP SIGNATURE- ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell] Converting a 'streaming' monad into a list
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ryan Ingram wrote: Hi everyone... it's my newbie post! I am trying to create a monad which allows computations to output data to a stream. (Probably such a thing already exists, but it's a good problem for my current skill level in Haskell) For example: streamDemo = do output 1 output 2 output 5 makelist streamDemo -- [1,2,5] I modelled my implementation around the state monad, but with a different execution model: class (Monad m) = MonadStream w m | m - w where output :: w - m () run :: m a - s - (s - w - s) - s -- basically foldl on the stream values makelist m = reverse $ run m [] (flip (:)) -- s is the type of the object to stream, r is the return type type StreamFunc s r = forall b. b - (b - s - b) - (r,b) newtype Stream s r = Stream { run' :: StreamFunc s r } instance Monad (Stream s) where return r = Stream (\s _ - (r,s)) Stream m = k = Stream (\s f - let (r,s') = (m s f) in run' (k r) s' f) instance (MonadStream w) (Stream w) where output w = Stream (\s f - ((),f s w)) run m st f = snd $ run' m st f What I don't like is how makelist comes out. It feels wrong to need to use reverse, and that also means that infinite streams completely fail to work. But I think it's impossible to fix with the foldl-style run. Is there a better implementation of makelist possible with my current definition of run? If not, what type should run have so that it can work correctly? As an example, I want to fix the implementation to make the following code work: fibs :: Stream Integer () fibs = fibs' 0 1 where fibs' x y = output y fibs' y (x+y) fiblist :: [Integer] fiblist = makelist fibs take 5 fiblist -- [1,1,2,3,5], but currently goes into an infinite loop As you might have guessed, reversing the list also forces it, thus making infinite lists impossible and long lists will perform badly. The trick is when you run the 'output' function to return that element and _then_ do the rest of the computation. What does this sounds like? That's right, the continuation monad! :) It's not as scary as it might sound like, it can basically be implemented with two one-liner functions (wow!). I've taken the liberty of writing your monad, except without the classes and instances: import Control.Monad.Cont type Stream r a = Cont [r] a output :: r - Stream r () output r = Cont $ \c - r : c () makelist :: Stream r () - [r] makelist m = runCont m (const []) fibs :: Num n = Stream n () fibs = fibs' 0 1 where fibs' x y = output x fibs' y (x+y) fiblist :: [Integer] fiblist = makelist fibs So, the output function returns its argument, then the result of the rest of the computation. makelist provides a stop to the continuation with the empty list. You recognize fibs and fiblist from your code. Is this what you where looking for? You can see the monad transformer version of this technique in the yet to be released library Binary ByteString: http://www.haskell.org/~kolmodin/code/bbs/src/Data/ByteString/Binary/EncM.hs Cheers, Lennart Kolmodin -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFllwn4txYG4KUCuERAo/UAJ9nXeGnaONCI4BDSn7YZIUFryB0VQCbBJpL lxw7HG17Yx0aPJXQ12gWPtA= =IEjs -END PGP SIGNATURE- ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell] Re: Converting a 'streaming' monad into a list
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: I am trying to create a monad which allows computations to output data to a stream. (Probably such a thing already exists, but it's a good problem for my current skill level in Haskell) For example: streamDemo = do output 1 output 2 output 5 makelist streamDemo -- [1,2,5] The trick is when you run the 'output' function to return that element and _then_ do the rest of the computation. What does this sounds like? That's right, the continuation monad! :) It's not as scary as it might sound like, it can basically be implemented with two one-liner functions (wow!). Well, I am pretty scared because the intended functionality is provided by good old MonadWriter: As you rightfully should.. output x = tell [x] streamDemo :: Writer [Integer] () streamDemo = do tell 1 tell 2 tell 5 execWriter streamDemo == [1,2,5] assuming an (instance Monoid [a] where ..) Oh, the Writer has much nicer properties than I thought. Lets have a look at the implementation (from GHC source) newtype Writer w a = Writer { runWriter :: (a, w) } instance (Monoid w) = Monad (Writer w) where return a = Writer (a, mempty) m = k = Writer $ let (a, w) = runWriter m (b, w') = runWriter (k a) in (b, w `mappend` w') instance Monoid [a] where mempty = [] mappend = (++) Oh, I see it clearer now. The first (++) will be used to join the first output with the rest, thus lazily returning the first one. It also seems to (suprise!) perform better than the continuation solution. Does it always return elements in O(1) ? Cheers, Lennart Kolmodin -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFlpeY4txYG4KUCuERAk/7AKC5BPweztpGfbj4tA6ckyOkG8PikwCfWHK0 PRd2S36VQQ0Ztsj8qLl8VkY= =j8rL -END PGP SIGNATURE- ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: hsman
Hi How would it work on Unix? I assume that the command-line program just takes it's input from the command line, so it doesn't get invoked until after you've finished typing the command... Not necessarily true if completion is involved ... see below. However, I know that zsh can do funky things like autocompleting ssh paths etc - and I think I remember seeing that there was some way a program could tell zsh what it could autocomplete to - but that is a hazy memory from a while ago. Have a look at the (unreleased) bash completion for ghc-pkg: http://www.haskell.org/~kolmodin/code/ghc-bash-completion/ghc-pkg source it in bash to get it started. As you can see that ghc-pkg doesn't have special support for autocompletion, but it's possible anyway. To make it a bit simpler to write the completion, it's nice if the application in question has support for it. A nice example of this is darcs[1] which implements the command '--commands' and the flag '--list-option'. Cheers, Lennart Kolmodin [1] http://www.abridgegame.org/repos/darcs-unstable/darcs_completion ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell] ANNOUNCE: hinotify 0.1
Greetings! I'm pleased to announce hinotify 0.1, a library to inotify[1] which has been part of the Linux kernel since 2.6.13. inotify provides file system event notification, simply add a watcher to a file or directory and get an event when it is accessed or modified. The API basically consists of: inotify_init :: IO INotify inotify_add_watch :: INotify - [EventVariety] -- different events to listen on - FilePath -- file/directory to watch - (Event - IO ()) -- event handler - IO WatchDescriptor inotify_rm_watch :: INotify - WatchDescriptor - IO () A sample program: import System.Directory import System.IO import System.INotify main :: IO () main = do inotify - inotify_init print inotify home - getHomeDirectory wd - inotify_add_watch inotify [Open,Close,Access,Modify,Move] home print print wd putStrLn Listens to your home directory. Hit enter to terminate. getLine inotify_rm_watch inotify wd The code is available via www: http://haskell.org/~kolmodin/code/hinotify/download/hinotify-0.1.tar.gz and via darcs: darcs get http://haskell.org/~kolmodin/code/hinotify/ The API is available at: http://haskell.org/~kolmodin/code/hinotify/docs/api/ The library is very young and I'm most grateful for feedback on the API, and what else you might have to suggest. Cheers, Lennart Kolmodin [1] http://www.kernel.org/pub/linux/kernel/people/rml/inotify/ ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: Error compiling using Network module
Jorge Guerra wrote: Hello to all, I have recently began using ghc, in particular the network module and I'm having problems with it. The following code ilustrates my problem, is very simple all I try to do is connect to a socket in my local machine send a request and print the response. [snip] When I try to compile it using the command: ghc -o socketTest socketTest.hs Try adding the network package as well; $ ghc -o socketTest socketTest.hs -package network You might also find the command $ ghc --make -o socketTest socketTest.hs useful since it will add exposed packages for you. Cheers, Lennart Kolmodin ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC as a package
Simon Marlow wrote: To compile GHC as a package, get a recent GHC source tree and set 'BuildPackageGHC=YES' in your mk/build.mk. You should also set $(GHC_PKG) to point to your ghc-pkg command. Then build ghc as normal, and in ghc/compiler say 'make install-inplace-pkg' to register the package (this won't do any actual installation, just register the package with your installed GHC). I have ghc-6.2.2 installed on my system and it could not build ghc if I set BuildPackageGHC=YES. It failed with WARNING: error while reading directory gnore-package ghc-6.2.2: file `ghc' does not exist so I guess it didn't understand the parameters -ignore-package ghc. If I download a recent snapshot of ghc-6.4, compile it, set BuildPackageGHC=YES, how can I compile the package using that compiler? And will that package be compatible with my installation of ghc-6.2.2? Thanks in advance, Lennart ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
GHC as a package
Hi! I'm working on an IDE for Haskell, written in Haskell. Currently, I'm looking for a way to parse .hs-files for a module browser and I recall that Simon Marlow was going to release GHC as a package soon. We could also use that package to compile source code without invoking ghc as a separate process. What is the status of the package and where can I get it? I can't find it in the CVS or in any of the snapshots. /Lennart ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users