From bertram.felgenhauer at googlemail.com Sun Jun 1 00:29:02 2008 From: bertram.felgenhauer at googlemail.com (Bertram Felgenhauer) Date: Sun Jun 1 00:21:54 2008 Subject: [Haskell-cafe] type-level integers using type families In-Reply-To: <48416FA4.7040402@gmail.com> References: <483E1FCF.9000101@gmail.com> <66615E96-5F85-4DAD-A280-1CEBF356B682@cse.unsw.edu.au> <483FEFB0.3060904@di.unipi.it> <48416FA4.7040402@gmail.com> Message-ID: <20080601042902.GA4221@zombie.inf.tu-dresden.de> Peter Gavin wrote: > Roberto Zunino wrote: >> Maybe he wants, given >> cond :: Cond x y z => x -> y -> z >> tt :: True >> true_exp :: a >> false_exp :: <<>> >> that >> cond tt true_exp false_exp :: a >> That is the type of false_exp is "lazily inferred", so that type errors >> do not make inference fail if they show up in an unneeded place. > > Yes, that's exactly what I want, but for type families (not MPTC). I think > it could be done if the type arguments were matched one at a time, across > all visible instances. What do you think of the following idea? Using naive type level natural numbers, > data Zero > newtype Succ a = Succ a Booleans, > data True > data False comparison, > type family (:<:) x y > type instance (Zero :<: Succ a) = True > type instance (Zero :<: Zero ) = False > type instance (Succ a :<: Zero ) = False > type instance (Succ a :<: Succ b) = a :<: b difference, > type family Minus x y > type instance Minus a Zero = a > type instance Minus (Succ a) (Succ b) = Minus a b and a higher order type level conditional, > type family Cond2 x :: (* -> * -> *) -> (* -> * -> *) -> * -> * -> * > type First2 (x :: * -> * -> *) (y :: * -> * -> *) = x > type Second2 (x :: * -> * -> *) (y :: * -> * -> *) = y > type instance Cond2 True = First2 > type instance Cond2 False = Second2 we can define division as follows: > type family Div x y > type DivZero x y = Zero > type DivStep x y = Succ (Div (Minus0 x y) y) > type instance Div x y = Cond2 (x :<: y) DivZero DivStep x y It's not exactly what you asked for, but I believe it gets the effect that you wanted. Enjoy, Bertram From thomas.dubuisson at gmail.com Sun Jun 1 02:11:22 2008 From: thomas.dubuisson at gmail.com (Thomas M. DuBuisson) Date: Sun Jun 1 01:59:44 2008 Subject: [Haskell-cafe] [ANN] Bindings to Xen Control (xenctrl.h) Message-ID: <1212300682.2448.14.camel@Clunker> All, I'm just getting started with hsXenCtrl [1] as both a fun way to play with Xen and become proficient with Haskell FFI. Once I get my community.haskell.org account squared away I'll likely setup a public darcs repo (and a homepage somewhere). As for modules: I intend to expand on the trival FFI bindings in System.Xen.CBindings and there'll be a higher level interface in System.Xen (functions will standardize on returning Either or throwing exceptions, hiding the xc_handle open/close, etc). Typical Disclaimers: The _only_ thing I've actually done with this, just tonight, is pause / unpause domains. API is subject to change! Only my exact build of Xen is sure to work, and no promise even then. TomMD [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsXenCtrl From dons at galois.com Sun Jun 1 02:31:40 2008 From: dons at galois.com (Don Stewart) Date: Sun Jun 1 02:24:41 2008 Subject: [Haskell-cafe] [ANN] Bindings to Xen Control (xenctrl.h) In-Reply-To: <1212300682.2448.14.camel@Clunker> References: <1212300682.2448.14.camel@Clunker> Message-ID: <20080601063140.GA1200@scytale.galois.com> thomas.dubuisson: > All, > I'm just getting started with hsXenCtrl [1] as both a fun way to play > with Xen and become proficient with Haskell FFI. Once I get my > community.haskell.org account squared away I'll likely setup a public > darcs repo (and a homepage somewhere). > > As for modules: I intend to expand on the trival FFI bindings in > System.Xen.CBindings and there'll be a higher level interface in > System.Xen (functions will standardize on returning Either or throwing > exceptions, hiding the xc_handle open/close, etc). > > Typical Disclaimers: > The _only_ thing I've actually done with this, just tonight, is pause / > unpause domains. API is subject to change! Only my exact build of Xen > is sure to work, and no promise even then. > > TomMD > > [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsXenCtrl Good stuff. Perhaps the synopsis should include a link or description of the typical use cases/ thinks we might achieve? -- Don From apfelmus at quantentunnel.de Sun Jun 1 03:37:39 2008 From: apfelmus at quantentunnel.de (apfelmus) Date: Sun Jun 1 03:30:40 2008 Subject: [Haskell-cafe] Re: appending an element to a list In-Reply-To: <48414C2B.9010606@daimi.au.dk> References: <483EE208.2010601@inf.fu-berlin.de> <483EF36B.5040100@daimi.au.dk> <48404039.6030605@cisco.com> <48405717.20206@daimi.au.dk> <87r6bja609.fsf@hbox.dyndns.org> <3c4d5adf0805302159o23113ad2sb24754e02789bb06@mail.gmail.com> <48414C2B.9010606@daimi.au.dk> Message-ID: Tillmann Rendel wrote: > Abhay Parvate wrote: >> I think I would like to make another note: when we talk about the complexity >> of a function, we are talking about the time taken to completely evaluate >> the result. Otherwise any expression in haskell will be O(1), since it >> just creates a thunk. > > I don't like this notion of complexity, since it seems not very suited > for the analysis of composite expression in Haskell. > > Is this intuitive view generalizable to arbitrary datatypes (instead of > lists) and formalized somewhere? See also the thread section beginning with http://thread.gmane.org/gmane.comp.lang.haskell.cafe/34398/focus=34435 Regards, apfelmus From vigalchin at gmail.com Sun Jun 1 04:00:27 2008 From: vigalchin at gmail.com (Galchin, Vasili) Date: Sun Jun 1 03:53:13 2008 Subject: [Haskell-cafe] modelling C in Haskell .. In-Reply-To: References: <5ae4f2ba0805292346y217d799du8a3e097a1e004e7a@mail.gmail.com> <5ae4f2ba0805300029s69b1a1fdn73e07fe17b458b10@mail.gmail.com> Message-ID: <5ae4f2ba0806010100j3788d29bj4aa0f5f4e3a8c5a8@mail.gmail.com> my knowledge of point-free is from category theory. in what sense is Haskell point-free handle namespace pollution? Kind regards, Vasili On Fri, May 30, 2008 at 3:23 AM, Jonathan Cast wrote: > On 30 May 2008, at 12:29 AM, Galchin, Vasili wrote: > > compactness in writing and also namespace pollution .. ;^) >> > > I know what the advantages of C's notation are. But getting the best > notation out of Haskell generally doesn't happen by trying to make your code > look like C. > > So the general answer to questions of the form `C can do x; can Haskell' is > `No'. Don't do it like in C. It won't be idiomatic, it won't be elegant, > and neither of us will like the results. Understand the features of Haskell > that make your program compact, point-free (how Haskell handles namespace > pollution), and elegant and use those. This will require a different > factoring of your program vs. C. Sorry, but that's life. > > jcc > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080601/72642831/attachment.htm From aruiz at um.es Sun Jun 1 06:20:03 2008 From: aruiz at um.es (Alberto Ruiz) Date: Sun Jun 1 06:12:51 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: References: Message-ID: <484277D3.9020604@um.es> Anatoly Yakovenko wrote: > What is the most efficient way to update a position in a matrix or a > vector? I came up with this: > > updateVector :: Vector Double -> Int -> Double -> Vector Double > updateVector vec pos val = vec `add` v2 > where > v2 = fromList $ (replicate (pos) 0.0) ++ ((val - (vec @> > pos)):(replicate ((dim vec)- pos - 1) 0.0)) > > but this seems pretty inefficient to me. > > thanks, > Anatoly > It is probably more efficient to use subVector and join (implemented by copyArray): updateVector' v pos val | pos == 0 = join [b,c] | pos == dim v -1 = join [a,b] | otherwise = join [a,b,c] where a = subVector 0 pos v b = fromList [val] c = subVector (pos+1) (dim v -pos-1) v > updateVector' (fromList [1,2,3,4,5]) 2 57 5 |> [1.0,2.0,57.0,4.0,5.0] (The three cases are required because empty vectors are not currently allowed.) Something similar can be done for matrices using flatten and reshape. Although vectors and matrices in this library are immutable and intended to be manipulated as a whole by higher level functions, this kind of update functions may often be useful. I will include them soon. Alberto From bertram.felgenhauer at googlemail.com Sun Jun 1 14:44:46 2008 From: bertram.felgenhauer at googlemail.com (Bertram Felgenhauer) Date: Sun Jun 1 14:37:38 2008 Subject: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1 Message-ID: <20080601184446.GA27750@zombie.inf.tu-dresden.de> Hi, I'm pleased to announce yet another tool for importing darcs repositories to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in Haskell, on top of the darcs2 source code. The result is a much faster program - it can convert the complete ghc 6.9 branch (without libraries) in less than 15 minutes on my slightly dated machine (Athlon XP 2500+), which is quite fast [3]. Incremental updates work, too. The program is still rough around the edges, and there's some cosmetical work to do, especially with respect to converting author names. The program should recover from most errors, as long as nobody else modifies the destination repository. Nevertheless, it seems quite useable already. I hope somebody finds this useful. You can grab the source at http://int-e.home.tlink.de/haskell/git-darcs-import-0.1.tar.bz2 Look at the README for further information. Credits go to: David Roundy and all contributors for darcs2. The code base is surprisingly pleasant to work with. And of course, Linus Torvalds, Junio Hamano and all other git contributors. Enjoy, Bertram [1] http://repo.or.cz/w/darcs2git.git?a=shortlog [2] http://git.sanityinc.com/?p=darcs-to-git.git [3] http://nominolo.blogspot.com/2008/05/thing-that-should-not-be-or-how-to.html From aeyakovenko at gmail.com Sun Jun 1 14:45:09 2008 From: aeyakovenko at gmail.com (Anatoly Yakovenko) Date: Sun Jun 1 14:37:55 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: <484277D3.9020604@um.es> References: <484277D3.9020604@um.es> Message-ID: do you have any plans to provide an interface for inplace updates? On Sun, Jun 1, 2008 at 3:20 AM, Alberto Ruiz wrote: > Anatoly Yakovenko wrote: >> >> What is the most efficient way to update a position in a matrix or a >> vector? I came up with this: >> >> updateVector :: Vector Double -> Int -> Double -> Vector Double >> updateVector vec pos val = vec `add` v2 >> where >> v2 = fromList $ (replicate (pos) 0.0) ++ ((val - (vec @> >> pos)):(replicate ((dim vec)- pos - 1) 0.0)) >> >> but this seems pretty inefficient to me. >> >> thanks, >> Anatoly >> > > It is probably more efficient to use subVector and join (implemented by > copyArray): > > updateVector' v pos val > | pos == 0 = join [b,c] > | pos == dim v -1 = join [a,b] > | otherwise = join [a,b,c] > where a = subVector 0 pos v > b = fromList [val] > c = subVector (pos+1) (dim v -pos-1) v > >> updateVector' (fromList [1,2,3,4,5]) 2 57 > 5 |> [1.0,2.0,57.0,4.0,5.0] > > (The three cases are required because empty vectors are not currently > allowed.) > > Something similar can be done for matrices using flatten and reshape. > > Although vectors and matrices in this library are immutable and intended to > be manipulated as a whole by higher level functions, this kind of update > functions may often be useful. I will include them soon. > > Alberto > From pieter at laeremans.org Sun Jun 1 18:18:36 2008 From: pieter at laeremans.org (Pieter Laeremans) Date: Sun Jun 1 18:11:20 2008 Subject: [Haskell-cafe] Ghc / cgi static linking Message-ID: Hello, I'm researching the use of Haskell to replace some perl scripts (in a web app). The app is deployed with a webhosting provider. CGI scripts can be executed => I can use Haskell. I've tried some hello world cgi scripts, compiled them on the same linux the hosting company uses and deployed them. It worked! But I would like to implement a search feature for the website. For Java/php/perl there 's lucene. For haskell there 's holumbus. Unfortunately, sqlite is a requirement for holumbus. It is not installed at the server of the hosting company. Is it possible to staticly link the sqlite3 library using ghc ? And are there other lucene like libs available like holumbus for haskell ? thanks in advance, Pieter -- Pieter Laeremans From dons at galois.com Sun Jun 1 18:26:00 2008 From: dons at galois.com (Don Stewart) Date: Sun Jun 1 18:18:48 2008 Subject: [Haskell-cafe] Ghc / cgi static linking In-Reply-To: References: Message-ID: <20080601222600.GE4759@scytale.galois.com> pieter: > Hello, > > I'm researching the use of Haskell to replace some perl scripts (in a web app). > The app is deployed with a webhosting provider. > > CGI scripts can be executed => I can use Haskell. I've tried some > hello world cgi scripts, compiled them on the same linux > the hosting company uses and deployed them. It worked! > > But I would like to implement a search feature for the website. For > Java/php/perl there 's lucene. > For haskell there 's holumbus. Unfortunately, sqlite is a requirement > for holumbus. It is not installed at the server of the > hosting company. > > Is it possible to staticly link the sqlite3 library using ghc ? Yes, it is entirely possible to statically link entire CGI apps. For example, this simple program, import Database.SQLite main = print "hey, test this" when compiled as $ ghc A.hs --make is dynamically linked against: $ ldd A A: Start End Type Open Ref GrpRef Name 0000000000000000 0000000000000000 exe 1 0 0 A 0000000041a85000 0000000041ee5000 rlib 0 1 0 /usr/local/lib/libsqlite3.so.9.0 0000000049b04000 0000000049f1d000 rlib 0 1 0 /usr/lib/libm.so.2.3 0000000042213000 000000004264f000 rlib 0 1 0 /usr/local/lib/libgmp.so.7.0 0000000047d0e000 00000000481e0000 rlib 0 1 0 /usr/lib/libc.so.42.0 0000000047900000 0000000047900000 rtld 0 1 0 /usr/libexec/ld.so Now, we can just pass some linker flags through to statically link this lot, $ ghc A.hs --make -optl-static -no-recomp $ ldd A ldd: A: not a dynamic executable $ file A A: ELF 64-bit LSB executable, AMD64, version 1, for OpenBSD, statically linked, not stripped I've added this information to the web programming FAQ, haskell.org/haskellwiki/Practical_web_programming_in_Haskell#Deploying_statically_linked_applications Note it also works for fastcgi, which when combined with Haskell's lightweight threads, makes a good option for performance-oriented web apps. -- Don From peteg42 at gmail.com Sun Jun 1 21:27:56 2008 From: peteg42 at gmail.com (Peter Gammie) Date: Sun Jun 1 21:21:09 2008 Subject: [Haskell-cafe] Ghc / cgi static linking In-Reply-To: <20080601222600.GE4759@scytale.galois.com> References: <20080601222600.GE4759@scytale.galois.com> Message-ID: <12F6690C-C370-4C25-B080-ADC3975318EC@gmail.com> On 02/06/2008, at 5:26 AM, Don Stewart wrote: > pieter: > Yes, it is entirely possible to statically link entire CGI apps. You might want to watch out for a bug in GHC 6.8.2 that means GHC's "- static" flag doesn't work. (At least for me, at least on Debian: the "- lpthread" flag is passed before the "-lrt" one, and symbols are left unresolved as a result.) Apparently the near-to-release 6.8.3 will fix this issue. Presumably dons is using a more recent GHC than 6.8.2, or other (BSD?) platforms are not affected. Note also you may have to tweak sundry .cabal files to add "extra- libraries" fields. As an example, I added this to HSQL's PostgreSQL backend to get it to statically link: extra-libraries: pq, crypt, pthread (If anyone cares you need to build PostgreSQL without kerberos as that doesn't seem to statically link any more.) cheers peter -- http://peteg.org/ From dons at galois.com Sun Jun 1 21:31:00 2008 From: dons at galois.com (Don Stewart) Date: Sun Jun 1 21:23:45 2008 Subject: [Haskell-cafe] Ghc / cgi static linking In-Reply-To: <12F6690C-C370-4C25-B080-ADC3975318EC@gmail.com> References: <20080601222600.GE4759@scytale.galois.com> <12F6690C-C370-4C25-B080-ADC3975318EC@gmail.com> Message-ID: <20080602013100.GJ4759@scytale.galois.com> peteg42: > On 02/06/2008, at 5:26 AM, Don Stewart wrote: > > >pieter: > >Yes, it is entirely possible to statically link entire CGI apps. > > You might want to watch out for a bug in GHC 6.8.2 that means GHC's "- > static" flag doesn't work. (At least for me, at least on Debian: the "- > lpthread" flag is passed before the "-lrt" one, and symbols are left > unresolved as a result.) Apparently the near-to-release 6.8.3 will fix > this issue. > > Presumably dons is using a more recent GHC than 6.8.2, or other (BSD?) > platforms are not affected. Yeah, that's the case. > Note also you may have to tweak sundry .cabal files to add "extra- > libraries" fields. As an example, I added this to HSQL's PostgreSQL > backend to get it to statically link: > > extra-libraries: pq, crypt, pthread > > (If anyone cares you need to build PostgreSQL without kerberos as that > doesn't seem to statically link any more.) > Hey Pete, Can you add these caveats to the wiki page? haskell.org/haskellwiki/Practical_web_programming_in_Haskell#Deploying_statically_linked_applications From donn at avvanta.com Sun Jun 1 22:08:38 2008 From: donn at avvanta.com (Donn Cave) Date: Sun Jun 1 22:00:44 2008 Subject: [Haskell-cafe] haskell compiler on NetBSD amd64 In-Reply-To: <20080510093512.GA27361@matstaff04.nuigalway.ie> References: <20080509222119.cfe30daa.donn@avvanta.com> <20080510093512.GA27361@matstaff04.nuigalway.ie> Message-ID: <20080601190838.61e222e3.donn@avvanta.com> On Sat, 10 May 2008 10:35:12 +0100 Emil Skoeldberg wrote: > On Fri, May 09, 2008 at 10:21:19PM -0700, Donn Cave wrote: > > So here I am with 64 bit Athlon hardware, running amd64 > > NetBSD (a.k.a. x86_64), reasonably motivated to compile > > Haskell. > > So, we are in the same boat then! OK, for you and me and probably no one else in the world, I have built 6.8.2, and for a short time I have it on-line - at my ISP's site, http://www.avvanta.com/~donn/ ... append file name, which is ghc-6.8.2-netbsd-amd64.tar.bz2 Size is ca. 54 Mb. When you want to use this to build future ghc releases, you'll probably have to modify libbfd.so to get GNU ar to index one or two of the larger libraries. I believe the release itself will work fine without this mod - ld uses the same library, but I think only ar has the problem. That cost me a lot of time. The other thing that cost me some time was the gmp dist in ghc-6.6.1, which didn't fully configure for the platform. The rest was reasonably straightforward. I built 6.6.1 .hc files on OpenBSD. -- Donn Cave From dons at galois.com Sun Jun 1 22:34:10 2008 From: dons at galois.com (Don Stewart) Date: Sun Jun 1 22:27:22 2008 Subject: [Haskell-cafe] haskell compiler on NetBSD amd64 In-Reply-To: <20080601190838.61e222e3.donn@avvanta.com> References: <20080509222119.cfe30daa.donn@avvanta.com> <20080510093512.GA27361@matstaff04.nuigalway.ie> <20080601190838.61e222e3.donn@avvanta.com> Message-ID: <20080602023410.GK4759@scytale.galois.com> donn: > On Sat, 10 May 2008 10:35:12 +0100 > Emil Skoeldberg wrote: > > > On Fri, May 09, 2008 at 10:21:19PM -0700, Donn Cave wrote: > > > So here I am with 64 bit Athlon hardware, running amd64 > > > NetBSD (a.k.a. x86_64), reasonably motivated to compile > > > Haskell. > > > > So, we are in the same boat then! > > OK, for you and me and probably no one else in the world, I have > built 6.8.2, and for a short time I have it on-line - at my ISP's > site, http://www.avvanta.com/~donn/ ... append file name, which > is ghc-6.8.2-netbsd-amd64.tar.bz2 Size is ca. 54 Mb. > > When you want to use this to build future ghc releases, you'll > probably have to modify libbfd.so to get GNU ar to index one > or two of the larger libraries. I believe the release itself > will work fine without this mod - ld uses the same library, but > I think only ar has the problem. > > That cost me a lot of time. The other thing that cost me some > time was the gmp dist in ghc-6.6.1, which didn't fully configure > for the platform. The rest was reasonably straightforward. > I built 6.6.1 .hc files on OpenBSD. Great work, let's get it up on the download page, http://haskell.org/ghc/download_ghc_682.html -- Don From donn at avvanta.com Sun Jun 1 23:50:12 2008 From: donn at avvanta.com (Donn Cave) Date: Sun Jun 1 23:42:18 2008 Subject: [Haskell-cafe] haskell compiler on NetBSD amd64 In-Reply-To: <20080602023410.GK4759@scytale.galois.com> References: <20080509222119.cfe30daa.donn@avvanta.com> <20080510093512.GA27361@matstaff04.nuigalway.ie> <20080601190838.61e222e3.donn@avvanta.com> <20080602023410.GK4759@scytale.galois.com> Message-ID: <20080601205012.6973f74a.donn@avvanta.com> On Sun, 1 Jun 2008 19:34:10 -0700 Don Stewart wrote: > Great work, let's get it up on the download page, > > http://haskell.org/ghc/download_ghc_682.html > Suits me, but now that I've had a chance to compile a little more Haskell with it, I think I might like to fix up a couple things. I'm not promising to make ghci work, though that would be nice, but mainly I'm talking about linker warnings attached to a couple of "compatibility" functions that got linked in when the more POSIX compliant versions would have been found if e.g. stdlib.h had been included. opendir(), unsetenv(), etc. So if that's agreeable, don't take the file I put on-line, I'll build up another one. thanks -- Donn Cave From thomas.dubuisson at gmail.com Mon Jun 2 00:19:24 2008 From: thomas.dubuisson at gmail.com (Thomas M. DuBuisson) Date: Mon Jun 2 00:07:35 2008 Subject: [Haskell-cafe] [ANN] Bindings to Xen Control (xenctrl.h) In-Reply-To: <20080601063140.GA1200@scytale.galois.com> References: <1212300682.2448.14.camel@Clunker> <20080601063140.GA1200@scytale.galois.com> Message-ID: <1212380364.2448.39.camel@Clunker> Don, I'll throw future work ideas in the next releases cabal. The most obvious doors opened are Haskell rewrites of the current Xen infrastructure (virt-install, xm, xend). Slightly more interesting tasks could be (warning: random thoughts): 1) HAPPS server that can manage Xen domains (without requiring python libs or System.cmd) 2) Network or BSD socket based remote management programs in Haskell. haxr or session-types might be of use here. 3) With the functions that can alter the CPUs availability, more complex rules or sharing arrangements could be implemented. Same concept applies to other resources such as PCI and memory allocation. Seeing as Xen doesn't over-commit memory, a guest VM program that detects low/high memory situations and reports to the host for policy controlled balloning (adjustment of VM allocated memory) would be kind of fun... but probably complete overkill for any user of Xen. Right now I think the bindings are enough for an 'xm' replacement but nothing more. I've over doubled the number of functions bound just now. There will probably be regular releases for the next few weeks as I find time. Thomas On Sat, 2008-05-31 at 23:31 -0700, Don Stewart wrote: > thomas.dubuisson: > > All, > > I'm just getting started with hsXenCtrl [1] as both a fun way to play > > with Xen and become proficient with Haskell FFI. Once I get my > > community.haskell.org account squared away I'll likely setup a public > > darcs repo (and a homepage somewhere). > > > > As for modules: I intend to expand on the trival FFI bindings in > > System.Xen.CBindings and there'll be a higher level interface in > > System.Xen (functions will standardize on returning Either or throwing > > exceptions, hiding the xc_handle open/close, etc). > > > > Typical Disclaimers: > > The _only_ thing I've actually done with this, just tonight, is pause / > > unpause domains. API is subject to change! Only my exact build of Xen > > is sure to work, and no promise even then. > > > > TomMD > > > > [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsXenCtrl > > Good stuff. Perhaps the synopsis should include a link or description of > the typical use cases/ thinks we might achieve? > > -- Don From abhay.parvate at gmail.com Mon Jun 2 01:04:07 2008 From: abhay.parvate at gmail.com (Abhay Parvate) Date: Mon Jun 2 00:56:51 2008 Subject: [Haskell-cafe] Re: appending an element to a list In-Reply-To: References: <483EE208.2010601@inf.fu-berlin.de> <483EF36B.5040100@daimi.au.dk> <48404039.6030605@cisco.com> <48405717.20206@daimi.au.dk> <87r6bja609.fsf@hbox.dyndns.org> <3c4d5adf0805302159o23113ad2sb24754e02789bb06@mail.gmail.com> <48414C2B.9010606@daimi.au.dk> Message-ID: <3c4d5adf0806012204p25133bdaxbc22955b70f094ff@mail.gmail.com> I somehow thought it would be easy to talk about complexity of calculating individual elements in an infinite list should be sufficient, but that seems to be involved, and my over-generalization doesn't seem to work. Thanks for the link; particularly it has reference to Wadler's papers exactly on this problem. Abhay On Sun, Jun 1, 2008 at 1:07 PM, apfelmus wrote: > Tillmann Rendel wrote: > >> Abhay Parvate wrote: >> >>> I think I would like to make another note: when we talk about the >>> complexity >>> of a function, we are talking about the time taken to completely evaluate >>> the result. Otherwise any expression in haskell will be O(1), since it >>> just creates a thunk. >>> >> >> I don't like this notion of complexity, since it seems not very suited for >> the analysis of composite expression in Haskell. >> >> Is this intuitive view generalizable to arbitrary datatypes (instead of >> lists) and formalized somewhere? >> > > See also the thread section beginning with > > http://thread.gmane.org/gmane.comp.lang.haskell.cafe/34398/focus=34435 > > > > Regards, > apfelmus > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080602/ad4530cb/attachment.htm From vigalchin at gmail.com Mon Jun 2 01:07:11 2008 From: vigalchin at gmail.com (Galchin, Vasili) Date: Mon Jun 2 00:59:54 2008 Subject: [Haskell-cafe] ghc 6.8.2 issue Message-ID: <5ae4f2ba0806012207i2797be95kf773d0cf75d6b39@mail.gmail.com> Hello, I have been developing new code for the "unix" package. I have run into what I think are ghc 6.8.2 anomalies but couldn't see a pattern. Possibly now I do. I have been using the 32-bit x86 ghc binary that I downloaded from http://www.haskell.org and running on Ubuntu Linux. I am pretty I can repeat now. Everything is ok until I do "sudo runhaskell Setup.hs install" which installs a new "unix" package that I just built. Of course the "intall" installs into /usr/local/lib/unix-2.3.0.0/ghc-6.8.2. The "install" seems to destroy some ghc compiler state under /usr/local ... This is of course just a theory. However, once I re-install ghc et. al. from the binary download then things are ok again. I have tried the ghc re-install at least 4 times. Hope I am not misleading anybody .. just trying to help! Kind regards, Vasili -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080602/088b1dc1/attachment.htm From yann at kierun.org Mon Jun 2 03:48:21 2008 From: yann at kierun.org (Yann Golanski) Date: Mon Jun 2 03:41:08 2008 Subject: [Haskell-cafe] Re: Images and GUIs in Haskell In-Reply-To: <20080601040910.545853dc@solaris> References: <62728db30805311530x6c28431fwf2615a18fac343cb@mail.gmail.com> <20080601014052.5658743f@solaris> <62728db30805311800s472cc708rf50bd77a70c65eb3@mail.gmail.com> <20080601040910.545853dc@solaris> Message-ID: <20080602074821.GC1271@kierun.org> Quoth Achim Schneider on Sun, Jun 01, 2008 at 04:09:10 +0200 > I would go for GL(U(T)), as it's as good for 2d primitives as SDL will > ever be, has excellent cross-platform support and allows you to go 3d > if you want to. There's also some very decent event handling. You can use R as well. http://www.r-project.org/ -- yann@kierun.org -= H+ =- www.kierun.org PGP: 009D 7287 C4A7 FD4F 1680 06E4 F751 7006 9DE2 6318 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080602/a80df81a/attachment.bin From jules at jellybean.co.uk Mon Jun 2 05:10:16 2008 From: jules at jellybean.co.uk (Jules Bean) Date: Mon Jun 2 05:02:59 2008 Subject: [Haskell-cafe] GHCi panic In-Reply-To: <48406AC1.4090003@btinternet.com> References: <48406AC1.4090003@btinternet.com> Message-ID: <4843B8F8.9070309@jellybean.co.uk> Andrew Coppin wrote: > I don't suppose this will surprise anybody greatly, but... > > Apparently if you write a Haskell module that is 400 KB in size and > defines a single CAF consisting of a 45,000-element [String], GHCi > panics when attempting to load it interpretted, and hits a stack > overflow attempting to load it compiled. qv http://hackage.haskell.org/trac/ghc/ticket/2002 From aruiz at um.es Mon Jun 2 05:37:14 2008 From: aruiz at um.es (Alberto Ruiz) Date: Mon Jun 2 05:29:57 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: References: <484277D3.9020604@um.es> Message-ID: <4843BF4A.2080800@um.es> Anatoly Yakovenko wrote: > do you have any plans to provide an interface for inplace updates? Yes, I will try to write a simple version of Data.Array.ST... > On Sun, Jun 1, 2008 at 3:20 AM, Alberto Ruiz wrote: >> Anatoly Yakovenko wrote: >>> What is the most efficient way to update a position in a matrix or a >>> vector? I came up with this: >>> >>> updateVector :: Vector Double -> Int -> Double -> Vector Double >>> updateVector vec pos val = vec `add` v2 >>> where >>> v2 = fromList $ (replicate (pos) 0.0) ++ ((val - (vec @> >>> pos)):(replicate ((dim vec)- pos - 1) 0.0)) >>> >>> but this seems pretty inefficient to me. >>> >>> thanks, >>> Anatoly >>> >> It is probably more efficient to use subVector and join (implemented by >> copyArray): >> >> updateVector' v pos val >> | pos == 0 = join [b,c] >> | pos == dim v -1 = join [a,b] >> | otherwise = join [a,b,c] >> where a = subVector 0 pos v >> b = fromList [val] >> c = subVector (pos+1) (dim v -pos-1) v >> >>> updateVector' (fromList [1,2,3,4,5]) 2 57 >> 5 |> [1.0,2.0,57.0,4.0,5.0] >> >> (The three cases are required because empty vectors are not currently >> allowed.) >> >> Something similar can be done for matrices using flatten and reshape. >> >> Although vectors and matrices in this library are immutable and intended to >> be manipulated as a whole by higher level functions, this kind of update >> functions may often be useful. I will include them soon. >> >> Alberto >> > From duncan.coutts at worc.ox.ac.uk Mon Jun 2 06:38:20 2008 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Mon Jun 2 06:28:00 2008 Subject: [Haskell-cafe] ghc 6.8.2 issue In-Reply-To: <5ae4f2ba0806012207i2797be95kf773d0cf75d6b39@mail.gmail.com> References: <5ae4f2ba0806012207i2797be95kf773d0cf75d6b39@mail.gmail.com> Message-ID: <1212403100.15010.133.camel@localhost> On Mon, 2008-06-02 at 00:07 -0500, Galchin, Vasili wrote: > Hello, > > I have been developing new code for the "unix" package. I have > run into what I think are ghc 6.8.2 anomalies but couldn't see a > pattern. Possibly now I do. I have been using the 32-bit x86 ghc > binary that I downloaded from http://www.haskell.org and running on > Ubuntu Linux. I am pretty I can repeat now. Everything is ok until I > do "sudo runhaskell Setup.hs install" which installs a new "unix" > package that I just built. Of course the "intall" installs > into /usr/local/lib/unix-2.3.0.0/ghc-6.8.2. The "install" seems to > destroy some ghc compiler state under /usr/local ... That sounds right. You're replacing the unix-2.3.0.0 library that comes with ghc-6.8.2 with your own version. It is highly unlikely to be ABI compatible with the one you are replacing and so all the other packages that already depends on the existing unix-2.3.0.0 library end up broken. You'd expect this kind of breakage to be exposed as link errors and segfaults. I suggest you do not replace any of the libraries that come with ghc. To be more precise, it is perfectly ok to *add new versions* but it is not ok to *replace existing versions* without rebuilding all the other libs that depend on it. Make sense? So if you really want to make changes to the unix lib, make sure you change the version number too. I also suggest not installing the packages as root, just install them locally. That way you can guarantee you never mess up your ghc install. You would be able to revert to a clean ghc install just by removing your ~/.ghc/$arch/ghc-6.8.2/package.conf file which will unregister *all* locally registered packages. To unregister individual packages use ghc-pkg --user unregister $pkgname Duncan From nominolo at googlemail.com Mon Jun 2 06:42:15 2008 From: nominolo at googlemail.com (Thomas Schilling) Date: Mon Jun 2 06:35:12 2008 Subject: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1 In-Reply-To: <20080601184446.GA27750@zombie.inf.tu-dresden.de> References: <20080601184446.GA27750@zombie.inf.tu-dresden.de> Message-ID: <8D4BA8BD-D3A2-4B56-B18E-FD6EA7A81D45@googlemail.com> On 1 jun 2008, at 20.44, Bertram Felgenhauer wrote: > Hi, > > I'm pleased to announce yet another tool for importing darcs > repositories > to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in > Haskell, on top of the darcs2 source code. The result is a much faster > program - it can convert the complete ghc 6.9 branch (without > libraries) > in less than 15 minutes on my slightly dated machine (Athlon XP 2500 > +), > which is quite fast [3]. Incremental updates work, too. > Nice! Do you happen to also have a darcs (or Git) repository somewhere? / Thomas -- Monkey killing monkey killing monkey over pieces of the ground. Silly monkeys give them thumbs they forge a blade And where there's one they're bound to divide it Right in two -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080602/084b0ebd/PGP.bin From bertram.felgenhauer at googlemail.com Mon Jun 2 08:05:03 2008 From: bertram.felgenhauer at googlemail.com (Bertram Felgenhauer) Date: Mon Jun 2 07:57:51 2008 Subject: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1 In-Reply-To: <8D4BA8BD-D3A2-4B56-B18E-FD6EA7A81D45@googlemail.com> References: <20080601184446.GA27750@zombie.inf.tu-dresden.de> <8D4BA8BD-D3A2-4B56-B18E-FD6EA7A81D45@googlemail.com> Message-ID: <20080602120503.GB4258@zombie.inf.tu-dresden.de> Thomas Schilling wrote: > > On 1 jun 2008, at 20.44, Bertram Felgenhauer wrote: [git-darcs-import] > > Nice! Do you happen to also have a darcs (or Git) repository somewhere? I've uploaded my (git) repo to repo.or.cz, see http://repo.or.cz/w/git-darcs-import.git Patches are welcome. enjoy, Bertram From devriese at cs.tcd.ie Mon Jun 2 09:05:11 2008 From: devriese at cs.tcd.ie (Edsko de Vries) Date: Mon Jun 2 08:57:56 2008 Subject: [Haskell-cafe] hs-plugins compile error Message-ID: <20080602130511.GA24905@netsoc.tcd.ie> Hi, I'm getting the compilation error that is actually logged on Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/plugins Below is a small diff file that resolves these problems; I don't know what the proper protocol is for submitting these diffs but it may be useful to someone. - E diff -ur plugins-1.2-orig/src/System/Plugins/Env.hs plugins-1.2/src/System/Plugins/Env.hs --- plugins-1.2-orig/src/System/Plugins/Env.hs 2008-06-02 14:57:59.000000000 +0100 +++ plugins-1.2/src/System/Plugins/Env.hs 2008-06-02 15:00:25.000000000 +0100 @@ -73,7 +73,7 @@ import Control.Concurrent.MVar ( MVar(), newMVar, withMVar ) -import Distribution.Package +import Distribution.Package hiding (packageName) import Text.ParserCombinators.ReadP import qualified Data.Map as M diff -ur plugins-1.2-orig/src/System/Plugins/PackageAPI.hs plugins-1.2/src/System/Plugins/PackageAPI.hs --- plugins-1.2-orig/src/System/Plugins/PackageAPI.hs 2008-06-02 14:57:59.000000000 +0100 +++ plugins-1.2/src/System/Plugins/PackageAPI.hs 2008-06-02 14:59:49.000000000 +0100 @@ -40,7 +40,7 @@ #if CABAL == 1 || __GLASGOW_HASKELL__ >= 604 import Distribution.InstalledPackageInfo -import Distribution.Package +import Distribution.Package hiding (depends, packageName) #else import System.Plugins.Package #endif diff -ur plugins-1.2-orig/src/System/Plugins/ParsePkgConfCabal.hs plugins-1.2/src/System/Plugins/ParsePkgConfCabal.hs --- plugins-1.2-orig/src/System/Plugins/ParsePkgConfCabal.hs 2008-06-02 14:57:59.000000000 +0100 +++ plugins-1.2/src/System/Plugins/ParsePkgConfCabal.hs 2008-06-02 14:58:56.000000000 +0100 @@ -6,7 +6,7 @@ ) where import Distribution.InstalledPackageInfo -import Distribution.Package +import Distribution.Package hiding (depends) import Distribution.Version import Data.Char ( isSpace, isAlpha, isAlphaNum, isUpper, isDigit ) From richardg at richardg.name Mon Jun 2 09:39:39 2008 From: richardg at richardg.name (Richard Giraud) Date: Mon Jun 2 09:32:24 2008 Subject: [Haskell-cafe] Mutually Recursive Modules Message-ID: <4843F81B.7060808@richardg.name> Hello I'm using GHC 6.8.2 with mutally recursive modules. I'm familiar with how to do simple cases in GHC ({-# SOURCE #-} and .hs-boot files) but I can't figure out how to get it to work for a particular set of modules. Is it known (i.e., proven) that GHC 6.8.2 can compile any set of mutually recursive modules without refactoring? Are there known limitations? Thanks, Richard G. From isaacdupree at charter.net Mon Jun 2 09:55:25 2008 From: isaacdupree at charter.net (Isaac Dupree) Date: Mon Jun 2 09:48:05 2008 Subject: [Haskell-cafe] Mutually Recursive Modules In-Reply-To: <4843F81B.7060808@richardg.name> References: <4843F81B.7060808@richardg.name> Message-ID: <4843FBCD.8000001@charter.net> Richard Giraud wrote: > Hello > > I'm using GHC 6.8.2 with mutally recursive modules. I'm familiar with > how to do simple cases in GHC ({-# SOURCE #-} and .hs-boot files) but I > can't figure out how to get it to work for a particular set of modules. > > Is it known (i.e., proven) that GHC 6.8.2 can compile any set of > mutually recursive modules without refactoring? Are there known > limitations? With the old (6.2 and before) .hi-boot scheme where there was no abstraction in boot-files, it could probably do anything that it could do. But I'm not convinced with .hs-boot... it can resolve one level of cycle, and I don't know how to *prove* that it *can't* do any given thing, but I strongly suspect there are things it can't do. Luckily, it is very often the case that your code will be better off anyway if refactored to have less module recursion. (though not always.) -Isaac From g9ks157k at acme.softbase.org Mon Jun 2 10:08:38 2008 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Mon Jun 2 10:01:32 2008 Subject: [Haskell-cafe] Re: Damnit, we need a CPAN. In-Reply-To: <20080530220930.6dff9dfa@solaris> References: <20080529173830.3aae4434@solaris> <200805301834.16537.g9ks157k@acme.softbase.org> <20080530220930.6dff9dfa@solaris> Message-ID: <200806021608.39009.g9ks157k@acme.softbase.org> Am Freitag, 30. Mai 2008 22:09 schrieb Achim Schneider: > [?] > I'm generally very interested in declarative GUI programming, but not > nearly enough acquainted with the whole topic to judge one project's > approach over the other. I just followed standard scientific evaluation > technique to select the projects to consider: The ones with the most and > most recent activity win. > > So far, my impression is that documentation is severely lacking, but > then I'm too busy watching Babylon 5 right now and did not get more > than half an hour or so looking at grapefruit. Okay, I think we?ll improve API documentation and then make a release, despite Grapefruit not being production quality yet. I hope, you?ll find it useful. :-) Best wishes, Wolfgang From aditya_siram at hotmail.com Mon Jun 2 10:37:11 2008 From: aditya_siram at hotmail.com (Aditya Siram) Date: Mon Jun 2 10:29:57 2008 Subject: [Haskell-cafe] What is the maturity of Haskell Web Frameworks Message-ID: I am building a web-app that, in broad strokes, allows a leader to assign tasks to team members and allows team members to accept/reject/pick tasks that they want to do. I really like Haskell and I would like to use it to implement the solution. Are frameworks like Happs ready? Not so much in terms of documentation, but in functionality and stability. -Deech _________________________________________________________________ Give to a good cause with every e-mail. Join the i?m Initiative from Microsoft. http://im.live.com/Messenger/IM/Join/Default.aspx?souce=EML_WL_ GoodCause From isaacdupree at charter.net Mon Jun 2 10:45:31 2008 From: isaacdupree at charter.net (Isaac Dupree) Date: Mon Jun 2 10:38:12 2008 Subject: [Haskell-cafe] Default definitions for associated type synonyms In-Reply-To: <52f14b210805300710k366731d6w340231d6eef3ef19@mail.gmail.com> References: <52f14b210805300710k366731d6w340231d6eef3ef19@mail.gmail.com> Message-ID: <4844078B.1010201@charter.net> Dreixel wrote: > Hello, > > Does anyone know if it is possible to specify a default definition for an > associated type synonym? When I tried: > > class A a where >> type B a = a >> > > GHC (version 6.9.20080309) told me: "Type declaration in a class must be a > kind signature or synonym default". However, when I look at the parser I see > no way to specify such synonym default. Is this possible? I'm curious... so, cc'ing glasgow-haskell-users mailinglist because the question is more likely to be noticed by relevant people there. > Thanks, > Z? Pedro From stefan at cs.uu.nl Mon Jun 2 10:50:00 2008 From: stefan at cs.uu.nl (Stefan Holdermans) Date: Mon Jun 2 10:42:48 2008 Subject: [Haskell-cafe] Default definitions for associated type synonyms In-Reply-To: <4844078B.1010201@charter.net> References: <52f14b210805300710k366731d6w340231d6eef3ef19@mail.gmail.com> <4844078B.1010201@charter.net> Message-ID: <9AAEC7D1-A1C3-4124-B2B0-E1F9F3E4675D@cs.uu.nl> Isaac, >> Does anyone know if it is possible to specify a default definition >> for an >> associated type synonym? According to http://hackage.haskell.org/trac/ghc/wiki/TypeFunctionsStatus defaults for associated types is still a TODO. Cheers, Stefan From daniel at dbpatterson.com Mon Jun 2 10:57:04 2008 From: daniel at dbpatterson.com (Daniel Patterson) Date: Mon Jun 2 10:47:10 2008 Subject: [Haskell-cafe] What is the maturity of Haskell Web Frameworks In-Reply-To: References: Message-ID: <20080602105704.1e4dc5ed@patagonia.local> You definitely could use HAppS for that, but considering that it sounds like a pretty small/lightweight app, you might want to check out hvac ( http://fmapfixreturn.wordpress.com/2008/03/23/ ), which is a newer (but still surprisingly full-featured) web framework. It is pretty lightweight, and might be easier to get working for your purposes. Daniel On Mon, 2 Jun 2008 09:37:11 -0500 Aditya Siram wrote: > > I am building a web-app that, in broad strokes, allows a leader to assign > tasks to team members and allows team members to accept/reject/pick tasks > that they want to do. > > I really like Haskell and I would like to use it to implement the solution. > Are frameworks like Happs ready? Not so much in terms of documentation, but > in functionality and stability. > > -Deech > _________________________________________________________________ > Give to a good cause with every e-mail. Join the i?m Initiative from > Microsoft. http://im.live.com/Messenger/IM/Join/Default.aspx?souce=EML_WL_ > GoodCause_______________________________________________ Haskell-Cafe mailing > list Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From marco-oweber at gmx.de Mon Jun 2 11:16:36 2008 From: marco-oweber at gmx.de (Marc Weber) Date: Mon Jun 2 11:09:20 2008 Subject: [Haskell-cafe] What is the maturity of Haskell Web Frameworks In-Reply-To: References: Message-ID: <20080602151636.GA20757@gmx.de> On Mon, Jun 02, 2008 at 09:37:11AM -0500, Aditya Siram wrote: > > I am building a web-app that, in broad strokes, allows a leader to assign tasks to team members and allows team members to accept/reject/pick tasks that they want to do. > > I really like Haskell and I would like to use it to implement the solution. Are frameworks like Happs ready? Not so much in terms of documentation, but in functionality and stability. Me too, but in this case if it's only about assigning tasks you should consider using existing solutions such as flysrpay or mantis http://www.mantisbt.org/ Maybe they fit your needs ? mit freundlichem Gruss Marc Weber From nominolo at googlemail.com Mon Jun 2 12:13:33 2008 From: nominolo at googlemail.com (Thomas Schilling) Date: Mon Jun 2 12:06:27 2008 Subject: [Haskell-cafe] Damnit, we need a CPAN. In-Reply-To: <20080529161307.GA17931@scytale.galois.com> References: <20080529173830.3aae4434@solaris> <404396ef0805290847w41cb7635ud6f655a9c096f28e@mail.gmail.com> <20080529110555.3d08fcb6@Eridanus.javasnob.homelinux.net> <20080529161307.GA17931@scytale.galois.com> Message-ID: On 29 maj 2008, at 18.13, Don Stewart wrote: >> Hackage and Cabal are nice, but a command line tool for automatically >> searching Hackage and installing Hackage packages (like the cpan >> program, or easy_install) would be nice. Unless I haven't done my >> homework and this tool exists... >> > > This tool exists. It is called 'cabal-install'. To try out one of > today's new packages: > > $ cabal update > $ cabal install category-extras > Another nice feature: Say you want to hack on the darcs version of a project, but you need to install the dependencies. If the project is Cabalised you can build and install the darcs version as well as all dependencies by calling 'cabal install' with no arguments inside the project directory. $ darcs get $ cd $ cabal install / Thomas -- Push the envelope. Watch it bend. -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080602/17c7ae5a/PGP.bin From tphyahoo at gmail.com Mon Jun 2 12:42:08 2008 From: tphyahoo at gmail.com (Thomas Hartman) Date: Mon Jun 2 12:34:51 2008 Subject: [Haskell-cafe] cabal install fail for happs-hsp-template Message-ID: <910ddf450806020942n4bc2fac8kc454aeda446b77ee@mail.gmail.com> Can cabal install be made to work for this package? ***** thartman@thartman-laptop:~>sudo cabal install happs-hsp-template [sudo] password for thartman: cabal: internal error: could not construct a valid install plan. The proposed (invalid) plan contained the following problems: Package Cabal is required by several packages, but they require inconsistent versions: package ghc-6.8.2 requires Cabal-1.2.3.0 package plugins-1.2 requires Cabal-1.5.2 thartman@thartman-laptop:~>cabal --version cabal-install version 0.4.7 using version 1.3.11 of the Cabal library thartman@thartman-laptop:~>ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.2 thartman@thartman-laptop:~>ghc-pkg list | grep -i ghc /usr/local/lib/ghc-6.8.2/package.conf: (ghc-6.8.2), haskell-src-1.0.1.1, haskell98-1.0.1.0, hpc-0.5.0.0, From tphyahoo at gmail.com Mon Jun 2 12:59:24 2008 From: tphyahoo at gmail.com (Thomas Hartman) Date: Mon Jun 2 12:52:06 2008 Subject: [Haskell-cafe] Re: cabal install fail for happs-hsp-template In-Reply-To: <910ddf450806020942n4bc2fac8kc454aeda446b77ee@mail.gmail.com> References: <910ddf450806020942n4bc2fac8kc454aeda446b77ee@mail.gmail.com> Message-ID: <910ddf450806020959i368abde0ud1080acc23734a0b@mail.gmail.com> I just noticed this is also reported as a 6.8 build failure on hackage itself. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/happs-hsp-template 2008/6/2 Thomas Hartman : > Can cabal install be made to work for this package? > ***** > thartman@thartman-laptop:~>sudo cabal install happs-hsp-template > [sudo] password for thartman: > cabal: internal error: could not construct a valid install plan. > The proposed (invalid) plan contained the following problems: > Package Cabal is required by several packages, but they require > inconsistent versions: > package ghc-6.8.2 requires Cabal-1.2.3.0 > package plugins-1.2 requires Cabal-1.5.2 > > > thartman@thartman-laptop:~>cabal --version > cabal-install version 0.4.7 > using version 1.3.11 of the Cabal library > thartman@thartman-laptop:~>ghc --version > The Glorious Glasgow Haskell Compilation System, version 6.8.2 > thartman@thartman-laptop:~>ghc-pkg list | grep -i ghc > /usr/local/lib/ghc-6.8.2/package.conf: > (ghc-6.8.2), haskell-src-1.0.1.1, haskell98-1.0.1.0, hpc-0.5.0.0, > From aeyakovenko at gmail.com Mon Jun 2 13:06:40 2008 From: aeyakovenko at gmail.com (Anatoly Yakovenko) Date: Mon Jun 2 12:59:21 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: <4843BF4A.2080800@um.es> References: <484277D3.9020604@um.es> <4843BF4A.2080800@um.es> Message-ID: >> do you have any plans to provide an interface for inplace updates? > > Yes, I will try to write a simple version of Data.Array.ST... > I can try to help you, although I still dont quite grok monads. Wouldn't it be more efficient to use StorableArray, so you can cast from and to C? I am not sure how vectors and matrixes are represented in C, but I imagine it should be possible to manipulate them without resorting to copying between haskell and C. From dons at galois.com Mon Jun 2 13:21:31 2008 From: dons at galois.com (Don Stewart) Date: Mon Jun 2 13:14:14 2008 Subject: [Haskell-cafe] What is the maturity of Haskell Web Frameworks In-Reply-To: References: Message-ID: <20080602172131.GA7534@scytale.galois.com> aditya_siram: > > I am building a web-app that, in broad strokes, allows a leader to > assign tasks to team members and allows team members to > accept/reject/pick tasks that they want to do. > > I really like Haskell and I would like to use it to implement the > solution. Are frameworks like Happs ready? Not so much in terms of > documentation, but in functionality and stability. HAppS is nice (see hpaste.org for example, which is nice and simple, and has been running for over a year). Another nice option in Haskell is using something like HStringTemplate or the xhtml combinators with fastcgi hooked into GHC's concurrency mechanisms. You can find *many* more things here, http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Network http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Web From bulat.ziganshin at gmail.com Mon Jun 2 13:21:34 2008 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Mon Jun 2 13:16:45 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: References: <484277D3.9020604@um.es> <4843BF4A.2080800@um.es> Message-ID: <814976210.20080602212134@gmail.com> Hello Anatoly, >> Yes, I will try to write a simple version of Data.Array.ST... > Wouldn't it be more efficient to use StorableArray, so you can cast there is some difference between them - MutableByteArray# (used for STUArray) is movable Haskell object which is subject to GC while StorableArray has a fixed address and allocated through C malloc(). this makes MBA more appropriate for small arrays while SA should be used for large ones because GC makes memory usage of program 3 times larger -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From dons at galois.com Mon Jun 2 13:24:01 2008 From: dons at galois.com (Don Stewart) Date: Mon Jun 2 13:16:50 2008 Subject: [Haskell-cafe] hs-plugins compile error In-Reply-To: <20080602130511.GA24905@netsoc.tcd.ie> References: <20080602130511.GA24905@netsoc.tcd.ie> Message-ID: <20080602172401.GB7534@scytale.galois.com> Thanks, if possible, could you construct this as a patch against the darcs branch, which lives here: http://code.haskell.org/~dons/code/hs-plugins Cheers, Don devriese: > Hi, > > I'm getting the compilation error that is actually logged on Hackage: > > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/plugins > > Below is a small diff file that resolves these problems; I don't know > what the proper protocol is for submitting these diffs but it may be > useful to someone. > > - E > > diff -ur plugins-1.2-orig/src/System/Plugins/Env.hs plugins-1.2/src/System/Plugins/Env.hs > --- plugins-1.2-orig/src/System/Plugins/Env.hs 2008-06-02 14:57:59.000000000 +0100 > +++ plugins-1.2/src/System/Plugins/Env.hs 2008-06-02 15:00:25.000000000 +0100 > @@ -73,7 +73,7 @@ > > import Control.Concurrent.MVar ( MVar(), newMVar, withMVar ) > > -import Distribution.Package > +import Distribution.Package hiding (packageName) > import Text.ParserCombinators.ReadP > > import qualified Data.Map as M > diff -ur plugins-1.2-orig/src/System/Plugins/PackageAPI.hs plugins-1.2/src/System/Plugins/PackageAPI.hs > --- plugins-1.2-orig/src/System/Plugins/PackageAPI.hs 2008-06-02 14:57:59.000000000 +0100 > +++ plugins-1.2/src/System/Plugins/PackageAPI.hs 2008-06-02 14:59:49.000000000 +0100 > @@ -40,7 +40,7 @@ > > #if CABAL == 1 || __GLASGOW_HASKELL__ >= 604 > import Distribution.InstalledPackageInfo > -import Distribution.Package > +import Distribution.Package hiding (depends, packageName) > #else > import System.Plugins.Package > #endif > diff -ur plugins-1.2-orig/src/System/Plugins/ParsePkgConfCabal.hs plugins-1.2/src/System/Plugins/ParsePkgConfCabal.hs > --- plugins-1.2-orig/src/System/Plugins/ParsePkgConfCabal.hs 2008-06-02 14:57:59.000000000 +0100 > +++ plugins-1.2/src/System/Plugins/ParsePkgConfCabal.hs 2008-06-02 14:58:56.000000000 +0100 > @@ -6,7 +6,7 @@ > ) where > > import Distribution.InstalledPackageInfo > -import Distribution.Package > +import Distribution.Package hiding (depends) > import Distribution.Version > > import Data.Char ( isSpace, isAlpha, isAlphaNum, isUpper, isDigit ) > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From ben.franksen at online.de Mon Jun 2 14:40:14 2008 From: ben.franksen at online.de (Ben Franksen) Date: Mon Jun 2 14:33:09 2008 Subject: [Haskell-cafe] Re: modelling C in Haskell .. References: <5ae4f2ba0805292346y217d799du8a3e097a1e004e7a@mail.gmail.com> <5ae4f2ba0805300029s69b1a1fdn73e07fe17b458b10@mail.gmail.com> <5ae4f2ba0806010100j3788d29bj4aa0f5f4e3a8c5a8@mail.gmail.com> Message-ID: Galchin, Vasili wrote: > my knowledge of point-free is from category theory. in what sense is > Haskell point-free handle namespace pollution? In the sense that you can write e.g. f = g . h instead of f x = g (h x) thereby avoiding the need to give a name the argument to f. Cheers Ben BTW, A: No. Q: Should I include quotations after my reply? From ben.franksen at online.de Mon Jun 2 14:53:30 2008 From: ben.franksen at online.de (Ben Franksen) Date: Mon Jun 2 14:46:22 2008 Subject: [Haskell-cafe] Re: modelling C in Haskell .. References: <5ae4f2ba0805292346y217d799du8a3e097a1e004e7a@mail.gmail.com> Message-ID: Galchin, Vasili wrote: > > typedef struct blah > { > int val1; > > union { > > int val2; > > struct { > > int val3; > > int val4; > } > } > } C_type; > > question: in Haskell, can I embed definition of the "union" inside of the > C typedef, i.e. recursion definition? Or must I have a separate definition > for the "union" which I "instantiate" inside the Haskell "typedef", i.e. > Haskell "data"? No. Each definition of a data type must occur at the top-level. Also, Haskell has only a very weak record system, a deficit that is generally agreed to be one of Haskell's greatest weaknesses. Like jcc, I'd also be interested what concrete problem prompted your question. While I have often found it annoying that in Haskell e.g. record labels are global in scope, I have never encountered a situation where I wanted to have lexically nested data type declarations. Cheers Ben From keith at oreilly.com Mon Jun 2 14:56:46 2008 From: keith at oreilly.com (Keith Fahlgren) Date: Mon Jun 2 14:49:29 2008 Subject: [Haskell-cafe] What is the maturity of Haskell Web Frameworks In-Reply-To: <20080602172131.GA7534@scytale.galois.com> References: <20080602172131.GA7534@scytale.galois.com> Message-ID: <4844426E.7010101@oreilly.com> On 6/2/08 10:21 AM, Don Stewart wrote: > aditya_siram: >> I am building a web-app that, in broad strokes, allows a leader to >> assign tasks to team members and allows team members to >> accept/reject/pick tasks that they want to do. >> >> I really like Haskell and I would like to use it to implement the >> solution. Are frameworks like Happs ready? Not so much in terms of >> documentation, but in functionality and stability. > > HAppS is nice (see hpaste.org for example, which is nice and simple, and > has been running for over a year). > > Another nice option in Haskell is using something like HStringTemplate > or the xhtml combinators with fastcgi hooked into GHC's concurrency > mechanisms. If you're interested in the background of rolling your own web stuff, I like Paul Brown's description of building perpubplat here: http://mult.ifario.us/t/blog HTH, Keith From devriese at cs.tcd.ie Mon Jun 2 15:23:32 2008 From: devriese at cs.tcd.ie (Edsko de Vries) Date: Mon Jun 2 15:16:15 2008 Subject: [Haskell-cafe] hs-plugins compile error In-Reply-To: <20080602172401.GB7534@scytale.galois.com> References: <20080602130511.GA24905@netsoc.tcd.ie> <20080602172401.GB7534@scytale.galois.com> Message-ID: <20080602192332.GB24905@netsoc.tcd.ie> Hi Don, Is this the kind of thing you mean (I'm not really a darcs user; this is the patch created by darcs record): [Hide some names to remove ambiguity errors Edsko de Vries **20080602202001] { hunk ./src/System/Plugins/Env.hs 76 -import Distribution.Package +import Distribution.Package hiding (packageName) hunk ./src/System/Plugins/PackageAPI.hs 43 -import Distribution.Package +import Distribution.Package hiding (depends, packageName) hunk ./src/System/Plugins/ParsePkgConfCabal.hs 9 -import Distribution.Package +import Distribution.Package hiding (depends) } Edsko From ekmett at gmail.com Mon Jun 2 15:25:28 2008 From: ekmett at gmail.com (Edward Kmett) Date: Mon Jun 2 15:18:12 2008 Subject: [Haskell-cafe] Re: [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters In-Reply-To: <4841CFB2.1020203@cs.pdx.edu> References: <48408014.30401@serpentine.com> <20080531005127.4b330ff7@solaris> <20080531202904.45054b49@solaris> <4841CFB2.1020203@cs.pdx.edu> Message-ID: <7fb8f82f0806021225l7bccc5det817cd572b1f0ca14@mail.gmail.com> On Sat, May 31, 2008 at 6:22 PM, Jim Snow wrote: > In practice, one might use something like 32 hash tables. This yields a > false positive rate of 1/(2^32). Their most obvious application is to store > the dictionary for a spell checker in a space-efficient way, though I have a > friend who wrote a paper on using them for router caches. One minor technicality is that you don't actually use k separate hash tables. You use k separate hash functions, and hash using different functions into the same physical table with a goal of having approximately half of the bits in the table set when all of your data is hashed. From jstrait at moonloop.net Mon Jun 2 15:48:12 2008 From: jstrait at moonloop.net (Jon Strait) Date: Mon Jun 2 15:51:46 2008 Subject: [Haskell-cafe] Vancouver Haskell users meeting Message-ID: <48444E7C.7050602@moonloop.net> An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080602/205dcae6/attachment-0001.htm From kr.angelov at gmail.com Mon Jun 2 16:35:22 2008 From: kr.angelov at gmail.com (Krasimir Angelov) Date: Mon Jun 2 16:28:04 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map Message-ID: Hi, I have to write ParseChart implementation with Data.Map/Set. The chart is type like this: type Chart k v = Map k (Set v) now I need operation like: insert :: k -> v -> Chart k v -> Maybe (Chart k v) where the result is (Just _) if the (k,v) is actually added to the chart or Nothing if it was already there and nothing have to be done. The straight forward implementation is: case Map.lookup k chart of Nothing -> Just (Map.insert k (Set.singleton v) chart) Just set | Set.member v set -> Nothing | otherwise -> Just (Map.insert k (Set.insert v set) chart) The problem with this is that both the Map and the Set are traversed twice. The first time from lookup/member and the second time from insert. Does someone have an idea how to do this with the current libraries? There are the Map.updateLookupWithKey and the Map.alter functions: updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a,Map k a) alter :: Ord k => (Maybe a -> Maybe a) -> k -> Map k a -> Map k a which are the closest that I need. The problem is that the first doesn't allow the client function to be called if there isn't matching key in the map and the second is doesn't allow to return value from the client function. What I really need is an alterLook?p function: alterLook?p :: Ord k => (Maybe a -> (b,Maybe a)) -> k -> Map k a -> (b,Map k a) The chart manipulation is in the tight loop of my application so I need fast code. Any other ideas? Regards, Krasimir From jstrait at moonloop.net Mon Jun 2 16:45:26 2008 From: jstrait at moonloop.net (Jon Strait) Date: Mon Jun 2 16:48:58 2008 Subject: [Haskell-cafe] Vancouver Haskell users meeting Message-ID: <48445BE6.4090108@moonloop.net> Anyone else here from Vancouver (Canada)? I thought it would be great to have a little informal get-together at a local cafe and share how we're currently using Haskell, or really anything (problems, comparisons, useful software tools, etc.) in relation to Haskell. I'm scheduling a meeting for this Thursday, June 5th. for 7PM at Waazubee Cafe - http://www.waazubee.com/content/directions.php (at Commercial Dr. and 1st Ave.) They have wireless internet access. I'll get a table near the back, bring my laptop, and will have a copy of Hudak's SOE book (the front cover is impossible to miss) out on the table. If anyone wants to meet, but this Thursday is not a good day for you, let me know what days are better and we'll move the meeting. If anyone is sure that they will come this Thursday, you might let me know, so I can have an idea about the resistance in changing the day, if needed. Thanks, Jon From dons at galois.com Mon Jun 2 17:09:21 2008 From: dons at galois.com (Don Stewart) Date: Mon Jun 2 17:02:06 2008 Subject: [Haskell-cafe] Vancouver Haskell users meeting In-Reply-To: <48445BE6.4090108@moonloop.net> References: <48445BE6.4090108@moonloop.net> Message-ID: <20080602210921.GC7820@scytale.galois.com> jstrait: > Anyone else here from Vancouver (Canada)? I thought it would be great > to have a little informal get-together at a local cafe and share how > we're currently using Haskell, or really anything (problems, > comparisons, useful software tools, etc.) in relation to Haskell. > > I'm scheduling a meeting for this Thursday, June 5th. for 7PM at > Waazubee Cafe - > http://www.waazubee.com/content/directions.php (at Commercial Dr. and > 1st Ave.) > > They have wireless internet access. I'll get a table near the back, > bring my laptop, and will have a copy of Hudak's SOE book (the front > cover is impossible to miss) out on the table. > > If anyone wants to meet, but this Thursday is not a good day for you, > let me know what days are better and we'll move the meeting. If anyone > is sure that they will come this Thursday, you might let me know, so I > can have an idea about the resistance in changing the day, if needed. Great! I've added these details to the events listing on http://haskell.org From ndmitchell at gmail.com Mon Jun 2 18:07:55 2008 From: ndmitchell at gmail.com (Neil Mitchell) Date: Mon Jun 2 18:00:46 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map In-Reply-To: References: Message-ID: <404396ef0806021507r312db11ak8eefb6e4087afccf@mail.gmail.com> Hi Krasimir, > insert :: k -> v -> Chart k v -> Maybe (Chart k v) > > where the result is (Just _) if the (k,v) is actually added to the > chart or Nothing if it was already there and nothing have to be done. insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a) This should provide the information you need, without the double traversal of the data structure. Thanks Neil From tphyahoo at gmail.com Mon Jun 2 18:15:50 2008 From: tphyahoo at gmail.com (Thomas Hartman) Date: Mon Jun 2 18:08:31 2008 Subject: [Haskell-cafe] hs-plugins compile error In-Reply-To: <20080602192332.GB24905@netsoc.tcd.ie> References: <20080602130511.GA24905@netsoc.tcd.ie> <20080602172401.GB7534@scytale.galois.com> <20080602192332.GB24905@netsoc.tcd.ie> Message-ID: <910ddf450806021515x4864ec26obeb735f2a53ea9fe@mail.gmail.com> after darcs record, darcs send -o file.patch and then send file.patch via email to the maintainer. 2008/6/2 Edsko de Vries : > Hi Don, > > Is this the kind of thing you mean (I'm not really a darcs user; this is > the patch created by darcs record): > > [Hide some names to remove ambiguity errors > Edsko de Vries **20080602202001] { > hunk ./src/System/Plugins/Env.hs 76 > -import Distribution.Package > +import Distribution.Package hiding (packageName) > hunk ./src/System/Plugins/PackageAPI.hs 43 > -import Distribution.Package > +import Distribution.Package hiding (depends, packageName) > hunk ./src/System/Plugins/ParsePkgConfCabal.hs 9 > -import Distribution.Package > +import Distribution.Package hiding (depends) > } > > Edsko > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From duncan.coutts at worc.ox.ac.uk Mon Jun 2 18:28:29 2008 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Mon Jun 2 18:17:52 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map In-Reply-To: References: Message-ID: <1212445709.15010.144.camel@localhost> On Mon, 2008-06-02 at 22:35 +0200, Krasimir Angelov wrote: > The problem with this is that both the Map and the Set are traversed > twice. The first time from lookup/member and the second time from > insert. Does someone have an idea how to do this with the current > libraries? > The chart manipulation is in the tight loop of my application so I > need fast code. Any other ideas? I'm not sure if it helps your application but we had a discussion on #haskell the other day about Data.Map and were talking about a general insert/modify/delete operator like: modify :: k -> Map k e -> (e, Maybe e -> Map k e) so it's a lookup that returns the element at k and also a continuation that lets you rebuild a new map with an altered element. I guess that doesn't account for the element not existing. There's probably a generalisation that does. Duncan From duncan.coutts at worc.ox.ac.uk Mon Jun 2 18:32:21 2008 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Mon Jun 2 18:21:41 2008 Subject: [Haskell-cafe] cabal install fail for happs-hsp-template In-Reply-To: <910ddf450806020942n4bc2fac8kc454aeda446b77ee@mail.gmail.com> References: <910ddf450806020942n4bc2fac8kc454aeda446b77ee@mail.gmail.com> Message-ID: <1212445941.15010.148.camel@localhost> On Mon, 2008-06-02 at 09:42 -0700, Thomas Hartman wrote: > Can cabal install be made to work for this package? > ***** > thartman@thartman-laptop:~>sudo cabal install happs-hsp-template > [sudo] password for thartman: > cabal: internal error: could not construct a valid install plan. > The proposed (invalid) plan contained the following problems: > Package Cabal is required by several packages, but they require > inconsistent versions: > package ghc-6.8.2 requires Cabal-1.2.3.0 > package plugins-1.2 requires Cabal-1.5.2 The package deps are not actually inconsistent, the problem is that the current cabal-install dependency resolution algorithm is completely naive and comes up with an invalid install plan. I'll let people know when the new dep resolver for cabal-install is ready (hopefully just a few days now). It should address this issue. Duncan From kr.angelov at gmail.com Mon Jun 2 18:33:24 2008 From: kr.angelov at gmail.com (Krasimir Angelov) Date: Mon Jun 2 18:26:04 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map In-Reply-To: <404396ef0806021507r312db11ak8eefb6e4087afccf@mail.gmail.com> References: <404396ef0806021507r312db11ak8eefb6e4087afccf@mail.gmail.com> Message-ID: Not completely! This is a possible implementation: case insertLookupWithKey (\_ -> Set.union) k (Set.singleton v) chart of (Nothing, chart) -> Just chart (Just set, chart) | Set.member v set -> Nothing | otherwise -> Just chart but notice that the set is still traversed twice. On Tue, Jun 3, 2008 at 12:07 AM, Neil Mitchell wrote: > Hi Krasimir, > >> insert :: k -> v -> Chart k v -> Maybe (Chart k v) >> >> where the result is (Just _) if the (k,v) is actually added to the >> chart or Nothing if it was already there and nothing have to be done. > > insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k > a -> (Maybe a, Map k a) > > This should provide the information you need, without the double > traversal of the data structure. > > Thanks > > Neil > From ndmitchell at gmail.com Mon Jun 2 18:41:30 2008 From: ndmitchell at gmail.com (Neil Mitchell) Date: Mon Jun 2 18:34:11 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map In-Reply-To: References: <404396ef0806021507r312db11ak8eefb6e4087afccf@mail.gmail.com> Message-ID: <404396ef0806021541v6d62f6ffgb198714f105100ff@mail.gmail.com> Hi > case insertLookupWithKey (\_ -> Set.union) k (Set.singleton v) chart of > (Nothing, chart) -> Just chart > (Just set, chart) | Set.member v set -> Nothing > | otherwise -> Just chart > > but notice that the set is still traversed twice. Yes, I missed that bit. I don't see any way of reducing that, other than using an unsafePerformIO and IORef to track the combining function - which is probably a really bad idea. Thanks Neil From ryani.spam at gmail.com Mon Jun 2 18:52:29 2008 From: ryani.spam at gmail.com (Ryan Ingram) Date: Mon Jun 2 18:45:09 2008 Subject: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met In-Reply-To: <1212192870.15596.1255975237@webmail.messagingengine.com> References: <20080531002837.0F09A3C8001@banane.furius.ca> <1212192870.15596.1255975237@webmail.messagingengine.com> Message-ID: <2f9b2d30806021552x36e5bcabw2727b04abfa9525f@mail.gmail.com> On 5/30/08, Martin Blais wrote: > Dear Philip, could you point your virtual finger towards a > reference/paper/book/any-bleeping-thing that would help this simple > beginner understand why it doesn't work in this case? I'm trying to > picture why a "read" function that terminates the program would be > useful anywhere. In fact, any library function other than something like > UNIX's "exit" or "kill" which terminates my program is not really > welcome in any of my computer programs, but then again, I haven't yet > been illuminated by the genie of pure functional languages. A reference > would be awesome. As others have pointed out, the reason why it doesn't work is due to lazy evaluation; the exception is "hidden" in a pure value and isn't triggered until some other bit of code causes the pure value to be evaluated. You can force the exception to be generated in your catch block by using "seq" (or "$!", which is implemented using "seq"). This forces the evaluation to happen at that point, although there are a lot of gotchas involved; for Int it works fine, though. Your question, then, requires asking "why would you want to hide an exception in a pure value"? The answer to that is quite interesting, but here's a simpler example that might enlighten you: head :: [a] -> a head (x:_) = x head _ = error "head: empty list" Just as you are required to prove before calling "head" that you aren't passing an empty list, for your program to be total, you should prove before calling "read" that the string parses properly. If you can't provide that proof (because, in this case, the string is provided by the user), you should be using another function for parsing. Don suggested "reads" to implement "maybeRead", which seems like a great idea to me. -- ryan From ndmitchell at gmail.com Mon Jun 2 19:07:32 2008 From: ndmitchell at gmail.com (Neil Mitchell) Date: Mon Jun 2 19:00:13 2008 Subject: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met In-Reply-To: <20080530235828.GI25572@scytale.galois.com> References: <20080531002837.0F09A3C8001@banane.furius.ca> <20080530235828.GI25572@scytale.galois.com> Message-ID: <404396ef0806021607x4b679180i8c3ec5255f2fe8e5@mail.gmail.com> Hi > The best thing to do is bypass read and use 'reads' to define your > own safe read. > > maybeRead :: Read a => String -> Maybe a > maybeRead s = case reads s of > [(x, "")] -> Just x > _ -> Nothing Or just use the Safe package: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/safe http://hackage.haskell.org/packages/archive/safe/0.2/doc/html/Safe.html#v%3AreadMay Thanks Neil From vigalchin at gmail.com Tue Jun 3 00:11:54 2008 From: vigalchin at gmail.com (Galchin, Vasili) Date: Tue Jun 3 00:04:39 2008 Subject: [Haskell-cafe] ghc 6.8.2 issue In-Reply-To: <1212403100.15010.133.camel@localhost> References: <5ae4f2ba0806012207i2797be95kf773d0cf75d6b39@mail.gmail.com> <1212403100.15010.133.camel@localhost> Message-ID: <5ae4f2ba0806022111l33fecf27xfbd6ee5f7dabf35f@mail.gmail.com> Hi Duncan, Not sure I agree the behavior is ok. E.g. here is a build of mmap: vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs clean cleaning... vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs configure Configuring bytestring-mmap-0.2.0... vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs build Preprocessing library bytestring-mmap-0.2.0... Building bytestring-mmap-0.2.0... [1 of 3] Compiling System.IO.Posix.MMap.Internal ( System/IO/Posix/MMap/Internal.hs, dist/build/System/IO/Posix/MMap/Internal.o ) [2 of 3] Compiling System.IO.Posix.MMap.Lazy ( System/IO/Posix/MMap/Lazy.hs, dist/build/System/IO/Posix/MMap/Lazy.o ) [3 of 3] Compiling System.IO.Posix.MMap ( System/IO/Posix/MMap.hs, dist/build/System/IO/Posix/MMap.o ) /usr/bin/ar: creating dist/build/libHSbytestring-mmap-0.2.0.a at this point rebuild and install the "unix" package ... vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs clean cleaning... vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs configure Configuring bytestring-mmap-0.2.0... vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs build Setup.lhs: error reading dist/setup-config; run "setup configure" command? "dist/setup-config" is not being populated at the end. In your response below, are you saying that teh segfaults occur because ghc itself relies on the "unix" package? Thanks, Vasili On Mon, Jun 2, 2008 at 5:38 AM, Duncan Coutts wrote: > > On Mon, 2008-06-02 at 00:07 -0500, Galchin, Vasili wrote: > > Hello, > > > > I have been developing new code for the "unix" package. I have > > run into what I think are ghc 6.8.2 anomalies but couldn't see a > > pattern. Possibly now I do. I have been using the 32-bit x86 ghc > > binary that I downloaded from http://www.haskell.org and running on > > Ubuntu Linux. I am pretty I can repeat now. Everything is ok until I > > do "sudo runhaskell Setup.hs install" which installs a new "unix" > > package that I just built. Of course the "intall" installs > > into /usr/local/lib/unix-2.3.0.0/ghc-6.8.2. The "install" seems to > > destroy some ghc compiler state under /usr/local ... > > That sounds right. You're replacing the unix-2.3.0.0 library that comes > with ghc-6.8.2 with your own version. It is highly unlikely to be ABI > compatible with the one you are replacing and so all the other packages > that already depends on the existing unix-2.3.0.0 library end up broken. > You'd expect this kind of breakage to be exposed as link errors and > segfaults. > > I suggest you do not replace any of the libraries that come with ghc. To > be more precise, it is perfectly ok to *add new versions* but it is not > ok to *replace existing versions* without rebuilding all the other libs > that depend on it. > > Make sense? > > So if you really want to make changes to the unix lib, make sure you > change the version number too. I also suggest not installing the > packages as root, just install them locally. That way you can guarantee > you never mess up your ghc install. You would be able to revert to a > clean ghc install just by removing your > ~/.ghc/$arch/ghc-6.8.2/package.conf file which will unregister *all* > locally registered packages. To unregister individual packages use > ghc-pkg --user unregister $pkgname > > Duncan > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080602/9975f150/attachment.htm From ajb at spamcop.net Tue Jun 3 00:47:30 2008 From: ajb at spamcop.net (ajb@spamcop.net) Date: Tue Jun 3 00:40:20 2008 Subject: [Haskell-cafe] Mutually Recursive Modules In-Reply-To: <4843FBCD.8000001@charter.net> References: <4843F81B.7060808@richardg.name> <4843FBCD.8000001@charter.net> Message-ID: <20080603004730.dzo6cyduskgsgo0w-nwo@webmail.spamcop.net> G'day all. Quoting Isaac Dupree : > Luckily, > it is very often the case that your code will be better off anyway if > refactored to have less module recursion. (though not always.) Nonetheless, I prefer not to leave the robustness of my code to luck. Besides, if I liked structuring code around artificial language restrictions, I'd be programming in C, not Haskell. Cheers, Andrew Bromage From vigalchin at gmail.com Tue Jun 3 01:04:26 2008 From: vigalchin at gmail.com (Galchin, Vasili) Date: Tue Jun 3 00:57:07 2008 Subject: [Haskell-cafe] ghc 6.8.2 issue In-Reply-To: <1212403100.15010.133.camel@localhost> References: <5ae4f2ba0806012207i2797be95kf773d0cf75d6b39@mail.gmail.com> <1212403100.15010.133.camel@localhost> Message-ID: <5ae4f2ba0806022204u51fb86dbs202783e73bb08573@mail.gmail.com> Duncan, By installing localling, I "runhaskell Setup.hs configure --prefix=$HOME" plus add local path to LD_LIBRARY_PATH and LD_RUN_PATH? On Linux, does ghc use .so's or is it linked statically? Vasili On Mon, Jun 2, 2008 at 5:38 AM, Duncan Coutts wrote: > > On Mon, 2008-06-02 at 00:07 -0500, Galchin, Vasili wrote: > > Hello, > > > > I have been developing new code for the "unix" package. I have > > run into what I think are ghc 6.8.2 anomalies but couldn't see a > > pattern. Possibly now I do. I have been using the 32-bit x86 ghc > > binary that I downloaded from http://www.haskell.org and running on > > Ubuntu Linux. I am pretty I can repeat now. Everything is ok until I > > do "sudo runhaskell Setup.hs install" which installs a new "unix" > > package that I just built. Of course the "intall" installs > > into /usr/local/lib/unix-2.3.0.0/ghc-6.8.2. The "install" seems to > > destroy some ghc compiler state under /usr/local ... > > That sounds right. You're replacing the unix-2.3.0.0 library that comes > with ghc-6.8.2 with your own version. It is highly unlikely to be ABI > compatible with the one you are replacing and so all the other packages > that already depends on the existing unix-2.3.0.0 library end up broken. > You'd expect this kind of breakage to be exposed as link errors and > segfaults. > > I suggest you do not replace any of the libraries that come with ghc. To > be more precise, it is perfectly ok to *add new versions* but it is not > ok to *replace existing versions* without rebuilding all the other libs > that depend on it. > > Make sense? > > So if you really want to make changes to the unix lib, make sure you > change the version number too. I also suggest not installing the > packages as root, just install them locally. That way you can guarantee > you never mess up your ghc install. You would be able to revert to a > clean ghc install just by removing your > ~/.ghc/$arch/ghc-6.8.2/package.conf file which will unregister *all* > locally registered packages. To unregister individual packages use > ghc-pkg --user unregister $pkgname > > Duncan > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080603/b5f7f5f5/attachment.htm From aruiz at um.es Tue Jun 3 03:27:54 2008 From: aruiz at um.es (Alberto Ruiz) Date: Tue Jun 3 03:20:38 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: References: <484277D3.9020604@um.es> <4843BF4A.2080800@um.es> Message-ID: <4844F27A.2080208@um.es> Anatoly Yakovenko wrote: >>> do you have any plans to provide an interface for inplace updates? >> Yes, I will try to write a simple version of Data.Array.ST... >> > > I can try to help you, although I still dont quite grok monads. > Wouldn't it be more efficient to use StorableArray, so you can cast > from and to C? I am not sure how vectors and matrixes are represented > in C, but I imagine it should be possible to manipulate them without > resorting to copying between haskell and C. > That's right, the correspondence with StorableArray is direct, and efficient conversion can be easily added to the library. I mentioned the idea of Data.Array.ST to have also the possibility of writing pure code, without IO, internally implemented with inplace updates. Alberto From bulat.ziganshin at gmail.com Tue Jun 3 03:37:21 2008 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Tue Jun 3 03:32:52 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: <4844F27A.2080208@um.es> References: <484277D3.9020604@um.es> <4843BF4A.2080800@um.es> <4844F27A.2080208@um.es> Message-ID: <731290342.20080603113721@gmail.com> Hello Alberto, Tuesday, June 3, 2008, 11:27:54 AM, you wrote: >>> Yes, I will try to write a simple version of Data.Array.ST... > That's right, the correspondence with StorableArray is direct, and > efficient conversion can be easily added to the library. I mentioned the > idea of Data.Array.ST to have also the possibility of writing pure code, > without IO, internally implemented with inplace updates. STRef/STArray operations are just IORef/IOArray operations imported in some way/ you can easily import any other operations to ST monad as far as you use rank-2 types to guarantee that impureness will not escape the runST call. look into unsafeIOtoST function providing unmovable STUArray variant may be a good idea -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From ketil at malde.org Tue Jun 3 04:26:47 2008 From: ketil at malde.org (Ketil Malde) Date: Tue Jun 3 04:19:12 2008 Subject: [Haskell-cafe] [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters In-Reply-To: <910ddf450805310933l668697b6w5816c98c7305c6cd@mail.gmail.com> (Thomas Hartman's message of "Sat\, 31 May 2008 09\:33\:52 -0700") References: <48408014.30401@serpentine.com> <910ddf450805310933l668697b6w5816c98c7305c6cd@mail.gmail.com> Message-ID: <87tzgancu0.fsf@malde.org> "Thomas Hartman" writes: > What kind of speed do you get on your laptop for Data.Set? How much > faster is the bloom filter? I tried to modify examples/Words.hs to use Data.Set insted. The results look like this (first Bloom, second Data.Set, both compiled with -O2): nmd9999:..filter/examples % ./Words 57025 words 0.013326ss to count words Bloom { 4194304 bits } 0.050608ss to construct filter 0.034806ss to query every element nmd9999:..filter/examples % ./WordsS 57025 words 0.013291ss to count words False 0.755115ss to construct filter 0.423289ss to query every element In order to avoid printing the entire set, while still evaluating it, I replaced the printing of the set with printing the result of a search for a non-existing element - I should really use a strict insert, I guess. Anyway, this hopefully gives an indication - looks like a factor of 10 in this case, but it will depend on the size of the data - more data, greater improvement. BTW, Nice work, Bryan! I have plans for this. -k -- If I haven't seen further, it is by standing in the footprints of giants From aruiz at um.es Tue Jun 3 04:56:50 2008 From: aruiz at um.es (Alberto Ruiz) Date: Tue Jun 3 04:52:49 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: <731290342.20080603113721@gmail.com> References: <484277D3.9020604@um.es> <4843BF4A.2080800@um.es> <4844F27A.2080208@um.es> <731290342.20080603113721@gmail.com> Message-ID: <48450752.4080307@um.es> Bulat Ziganshin wrote: > Hello Alberto, > > Tuesday, June 3, 2008, 11:27:54 AM, you wrote: > >>>> Yes, I will try to write a simple version of Data.Array.ST... >> That's right, the correspondence with StorableArray is direct, and >> efficient conversion can be easily added to the library. I mentioned the >> idea of Data.Array.ST to have also the possibility of writing pure code, >> without IO, internally implemented with inplace updates. > > STRef/STArray operations are just IORef/IOArray operations imported in > some way/ you can easily import any other operations to ST monad as > far as you use rank-2 types to guarantee that impureness will not > escape the runST call. look into unsafeIOtoST function Good! So you can easily "hide" the IO operations in the ST monad. I will definitely look into it. > providing unmovable STUArray variant may be a good idea > > Many thanks Bulat! From duncan.coutts at worc.ox.ac.uk Tue Jun 3 05:05:26 2008 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Tue Jun 3 04:54:45 2008 Subject: [Haskell-cafe] ghc 6.8.2 issue In-Reply-To: <5ae4f2ba0806022111l33fecf27xfbd6ee5f7dabf35f@mail.gmail.com> References: <5ae4f2ba0806012207i2797be95kf773d0cf75d6b39@mail.gmail.com> <1212403100.15010.133.camel@localhost> <5ae4f2ba0806022111l33fecf27xfbd6ee5f7dabf35f@mail.gmail.com> Message-ID: <1212483926.15010.192.camel@localhost> On Mon, 2008-06-02 at 23:11 -0500, Galchin, Vasili wrote: > at this point rebuild and install the "unix" package ... > > vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell > Setup.lhs clean > cleaning... > vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell > Setup.lhs configure > Configuring bytestring-mmap-0.2.0... > vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell > Setup.lhs build > Setup.lhs: error reading dist/setup-config; run "setup configure" > command? > > "dist/setup-config" is not being populated at the end. In your > response below, are you saying that teh segfaults occur because ghc > itself relies on the "unix" package? Something like that yes. You're running runhaskell Setup.lhs and that loads and runs code from the Cabal library. The Cabal library depends on the process library which depends on the unix library. So by replacing the same version of the unix package you're breaking everything else which depends on it, including Cabal and thus runhaskell Setup.lhs. So the solution is to not do that. Don't re-install the exact same version of any of the core libs that come with ghc. Adding new versions is fine, replacing existing versions is not fine because it breaks all the other packages that were already built against that package. Duncan From duncan.coutts at worc.ox.ac.uk Tue Jun 3 05:11:06 2008 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Tue Jun 3 05:00:23 2008 Subject: [Haskell-cafe] ghc 6.8.2 issue In-Reply-To: <5ae4f2ba0806022204u51fb86dbs202783e73bb08573@mail.gmail.com> References: <5ae4f2ba0806012207i2797be95kf773d0cf75d6b39@mail.gmail.com> <1212403100.15010.133.camel@localhost> <5ae4f2ba0806022204u51fb86dbs202783e73bb08573@mail.gmail.com> Message-ID: <1212484266.15010.199.camel@localhost> On Tue, 2008-06-03 at 00:04 -0500, Galchin, Vasili wrote: > Duncan, > > By installing localling, I "runhaskell Setup.hs configure > --prefix=$HOME" plus add local path to LD_LIBRARY_PATH and > LD_RUN_PATH? On Linux, does ghc use .so's or is it linked statically? ghc is linked statically but when you do things like runhaskell Setup.hs you're asking ghc to dynamically load packages. runhaskell/runghc is basically a form of ghci, and ghci does dynamic code loading. If you've broken some of the packages that ghci loads and runs code from then you'll run into problems, mysterious segfaults and the like. As I understand it, in the next version of ghc it will track the ABI of each package so we would be able to detect when people replace packages with ones with the same version but with a different ABI (as you've been doing) and refuse to link or run in those cases rather than running and ending up with segfaults. Duncan From apfelmus at quantentunnel.de Tue Jun 3 05:14:58 2008 From: apfelmus at quantentunnel.de (apfelmus) Date: Tue Jun 3 05:07:51 2008 Subject: [Haskell-cafe] Re: appending an element to a list In-Reply-To: <3c4d5adf0806012204p25133bdaxbc22955b70f094ff@mail.gmail.com> References: <483EE208.2010601@inf.fu-berlin.de> <483EF36B.5040100@daimi.au.dk> <48404039.6030605@cisco.com> <48405717.20206@daimi.au.dk> <87r6bja609.fsf@hbox.dyndns.org> <3c4d5adf0805302159o23113ad2sb24754e02789bb06@mail.gmail.com> <48414C2B.9010606@daimi.au.dk> <3c4d5adf0806012204p25133bdaxbc22955b70f094ff@mail.gmail.com> Message-ID: Abhay Parvate wrote: > I somehow thought it would be easy to talk about complexity of calculating > individual elements in an infinite list should be sufficient, but that seems > to be involved, and my over-generalization doesn't seem to work. Thanks for > the link; particularly it has reference to Wadler's papers exactly on this > problem. Note however that Wadler's and similar formalisms are still a unsatisfactory in that they are quite clumsy to work with, it's quite tedious/impossible to analyze examples with a lot of lazy evaluation. But they are a good guideline. In his book about purely functional data structures [1], Okasaki takes a different approach; each node of a data structure is given a debit, a cost to evaluate it. For instance, consider xs = x1 : x2 : x3 : ... : xn : [] 1 1 1 ... 1 1 0 ys = y1 : y2 : y3 : ... : ym : [] 1 1 1 ... 1 1 0 The numbers below indicate the time it takes to evaluate the node to weak head normal form. For demonstration purposes, I arbitrarily chose 1 for each (:) here. The combined list will then have debits like xs ++ ys = x1 : x2 : x3 : ... : xn : y1 : y2 : y3 : ... : ym : [] 2 2 2 ... 2 2 1 1 1 ... 1 1 0 In other words, the ys list is copied verbatim but each element of xs incurs an additional cost of 1, corresponding to one step in the evaluation of the concatenation with (++). In order to force/inspect a constructor/node, you have to pay off its debits first. In the above example, head (xs ++ ys) would have to pay 2 units of time (one unit for head xs and one for the (++)). Now, the thing about debits is that we can relocate them to the top and only overestimate the total running time if we do that. For instance, we could push all debits to the top xs ++ ys = x1 : x2 : x3 : ... : xn : y1 : y2 : y3 : ... : ym : [] 2n+m 0 0 ... 0 0 0 0 0 ... 0 0 0 so that evaluating head (xs ++ ys) is now estimated to cost (2n+m) units of time while the rest is free/fully evaluated. The above example is rather useless, but consider the case n == m and xs = x1 : x2 : x3 : ... : xn : [] 0 0 0 ... 0 0 0 ys = y1 : y2 : y3 : ... : yn : [] 0 0 0 ... 0 0 0 i.e. two fully evaluated lists of the same length. Then, we have xs ++ reverse ys = x1 : x2 : x3 : ... : xn : yn : y{n-1} : ... : y1 : [] 1 1 1 ... 1 1 n 0 ... 0 0 0 because reversing the list ys is "monolithic", i.e. looking at its head already forces the tail of the list. But now, we can distribute the debits upwards xs ++ reverse ys = x1 : x2 : x3 : ... : xn : yn : y{n-1} : ... : y1 : [] 2 2 2 ... 2 2 0 0 ... 0 0 0 and thereby amortize the cost of reversing the second lists over the n elements of the first list. This is used in the implementation of purely functional queues, see also Okasaki's book. [1]: Chris Okasaki. Purely Function Data Structures. http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf (This is the thesis on which the book is based.) Regards, apfelmus From bulat.ziganshin at gmail.com Tue Jun 3 05:42:11 2008 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Tue Jun 3 05:37:59 2008 Subject: [Haskell-cafe] Re: hmatrix In-Reply-To: <48450752.4080307@um.es> References: <484277D3.9020604@um.es> <4843BF4A.2080800@um.es> <4844F27A.2080208@um.es> <731290342.20080603113721@gmail.com> <48450752.4080307@um.es> Message-ID: <483842413.20080603134211@gmail.com> Hello Alberto, Tuesday, June 3, 2008, 12:56:50 PM, you wrote: > Good! So you can easily "hide" the IO operations in the ST monad. I will > definitely look into it. from implementation POV ST monad is nothing but renamed IO monad which exports only subset of its operations which are guaranteed to safe. or, saying in other words, it's just type hackery around IO monad that provides safe operations it's possible to define ST monad and its operations as following: newtype ST s a = forall s. ST_Constructor (IO a) unsafeIOtoSt action = ST_Constructor action runST (ST_Constructor action) = unsafePerformIO action newtype STRef s a = forall s. STRef (IORef a) readSTRef (STRef ref) = unsafeIOtoSt (readIORef ref) and so on. GHC uses technically (but not ideologically!) different implementation where both monads are specializations of one generic type. while Hugs afair uses exactly this approach. you may also look at ArrayRef lib which reimplements arrays/refs for both compilers in more unified way anyway, because ST is just IO monad modulo type tricks, you can execute any IO action inside ST by lifting it with unsafeIOtoSt -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From yann at kierun.org Tue Jun 3 06:30:26 2008 From: yann at kierun.org (Yann Golanski) Date: Tue Jun 3 06:23:09 2008 Subject: [Haskell-cafe] Rotating backdrop (aka learning Haskell) In-Reply-To: <20080520081557.GA18833@kierun.org> References: <20080520081557.GA18833@kierun.org> Message-ID: <20080603103026.GA10131@kierun.org> First version is available at: http://www.kierun.org/backdropper-1.0.tbz2 It is minimal but does the trick of randomly rotating backgrounds. Features to add are only rotate during work hours, making sure that all images are shown within a day and a nice GUI. Criticism welcome. -- yann@kierun.org -= H+ =- www.kierun.org PGP: 009D 7287 C4A7 FD4F 1680 06E4 F751 7006 9DE2 6318 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080603/3ac7216c/attachment.bin From gale at sefer.org Tue Jun 3 07:45:11 2008 From: gale at sefer.org (Yitzchak Gale) Date: Tue Jun 3 07:37:51 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map In-Reply-To: <404396ef0806021541v6d62f6ffgb198714f105100ff@mail.gmail.com> References: <404396ef0806021507r312db11ak8eefb6e4087afccf@mail.gmail.com> <404396ef0806021541v6d62f6ffgb198714f105100ff@mail.gmail.com> Message-ID: <2608b8a80806030445x5272d3e2o78e3cb4aef6821ed@mail.gmail.com> Krasimir Angelov wrote: >> but notice that the set is still traversed twice. Neil Mitchell wrote: > I don't see any way of reducing that Yeah, it looks like the Data.Set (and Data.IntSet) library is missing the functions insertMember :: Ord a => a -> Set a -> (Bool, Set a) deleteMember :: Ord a => a -> Set a -> (Bool, Set a) analagous to splitMember. It should be easy to write those functions. If you do that for yourself, consider making a patch of them and submitting the patch as a library proposal. But anyway, a set lookup is very cheap, even for a set that is quite large. You may want to try just doing the extra lookup, it might be good enough for you. At least you eliminated the Map lookup. Regards, Yitz From kr.angelov at gmail.com Tue Jun 3 07:54:03 2008 From: kr.angelov at gmail.com (Krasimir Angelov) Date: Tue Jun 3 07:46:43 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map In-Reply-To: <2608b8a80806030445x5272d3e2o78e3cb4aef6821ed@mail.gmail.com> References: <404396ef0806021507r312db11ak8eefb6e4087afccf@mail.gmail.com> <404396ef0806021541v6d62f6ffgb198714f105100ff@mail.gmail.com> <2608b8a80806030445x5272d3e2o78e3cb4aef6821ed@mail.gmail.com> Message-ID: I actually made my own copy of Data.Map and added an extra: alterLook?p :: Ord k => (Maybe a -> (b,Maybe a)) -> k -> Map k a -> (b,Map k a) function. I also changed my data type to: type ParseChart k v = Map k (Map v ()) so I don't have to copy the Data.Set module also. Unfortunately this doesn't give much better performance - 5734 msec instead of 5828 msec. Fortunately I found that there is a way to avoid to use Map at all in one common case. This gave me time about 5024 msec. Regards, Krasimir On 6/3/08, Yitzchak Gale wrote: > Krasimir Angelov wrote: > >> but notice that the set is still traversed twice. > > Neil Mitchell wrote: > > I don't see any way of reducing that > > Yeah, it looks like the Data.Set (and Data.IntSet) library > is missing the functions > > insertMember :: Ord a => a -> Set a -> (Bool, Set a) > deleteMember :: Ord a => a -> Set a -> (Bool, Set a) > > analagous to splitMember. It should be easy to write > those functions. If you do that for yourself, consider > making a patch of them and submitting the patch > as a library proposal. > > But anyway, a set lookup is very cheap, even for a > set that is quite large. You may want to try just doing > the extra lookup, it might be good enough for you. > At least you eliminated the Map lookup. > > Regards, > Yitz > From ahey at iee.org Tue Jun 3 09:28:29 2008 From: ahey at iee.org (Adrian Hey) Date: Tue Jun 3 09:21:13 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map In-Reply-To: References: Message-ID: <484546FD.5050005@iee.org> Hello Krasimir, Krasimir Angelov wrote: > Hi, > > I have to write ParseChart implementation with Data.Map/Set. The chart > is type like this: > > type Chart k v = Map k (Set v) > > now I need operation like: > > insert :: k -> v -> Chart k v -> Maybe (Chart k v) > > where the result is (Just _) if the (k,v) is actually added to the > chart or Nothing if it was already there and nothing have to be done. > The straight forward implementation is: > > case Map.lookup k chart of > Nothing -> Just (Map.insert k (Set.singleton v) chart) > Just set | Set.member v set -> Nothing > | otherwise -> Just (Map.insert k > (Set.insert v set) chart) > You can do this quite easily with the AVL library, something like this (untested code) import Data.Cordering import Data.Tree.AVL type Chart k v = AVL (k, AVL v) insert :: (Ord k, Ord v) => k -> v -> Chart k v -> Maybe (Chart k v) insert k v tk = case genOpenPathWith cmpk tk of EmptyBP pthk -> Just $! insertPath pthk (k, singleton v) tk FullBP pthk tv -> case genOpenPath (compare v) tv of EmptyBP pthv -> let tv' = insertPath pthv v tv in tv' `seq` (Just $! writePath pthk (k, tv') tk) FullBP _ _ -> Nothing where cmpk (k',tv) = case compare k k' of LT -> Lt EQ -> Eq tv GT -> Gt ..or something like that (maybe you don't want all that strictness) The insertPath & writePath functions do involve a second traversal but do not repeat all the comparisons. Also, provided not too much has happened in between, they should be very fast as the nodes on the path are probably still in cache. The important thing is that in the case where Nothing is returned you'll have burned very little heap. Regards -- Adrian Hey From jtod at dcs.gla.ac.uk Tue Jun 3 10:07:33 2008 From: jtod at dcs.gla.ac.uk (John O'Donnell) Date: Tue Jun 3 10:00:43 2008 Subject: [Haskell-cafe] hs-plugins compile error References: <20080602130511.GA24905@netsoc.tcd.ie><20080602172401.GB7534@scytale.galois.com> <20080602192332.GB24905@netsoc.tcd.ie> Message-ID: Hi, What is the status of hs-plugins? I recently tried to install the version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9 and ghc-6.8.2, but didn't get past the configure stage (see config.log below). The installation script is invoking gcc with a -V command line argument but according to gcc documentation -V requires an argument. Has anyone managed to get hs-plugins to work? If so, what platform, which version of ghc and gcc, and where did you find the hs-plugins source? Best wishes, John O'Donnell ... from config.log... gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) configure:1852: $? = 0 configure:1854: gcc -V &5 gcc: '-V' option must have argument configure:1857: $? = 1 configure:1880: checking for C compiler default output file name configure:1883: gcc conftest.c >&5 conftest.c:9:13: warning: missing terminating " character conftest.c:10: error: stray '\33' in program conftest.c:10: error: expected identifier or '(' before '[' token conftest.c:10:4: error: invalid suffix "h" on integer constant conftest.c:10:9: warning: missing terminating " character conftest.c:10: error: missing terminating " character configure:1886: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define LEADING_UNDERSCORE 0 | #define TOP "/home/jtod/system/installs/hs-plugins/hs-plugins-1.2 | ESC[?1034h" | #define WITH_GHC "ghc" | #define GHC_LIB_PATH "/usr/local/lib/ghc-6.8.2" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:1925: error: C compiler cannot create executables -----Original Message----- From: haskell-cafe-bounces@haskell.org on behalf of Edsko de Vries Sent: Mon 2008-06-02 20:23 To: Don Stewart Cc: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] hs-plugins compile error Hi Don, Is this the kind of thing you mean (I'm not really a darcs user; this is the patch created by darcs record): [Hide some names to remove ambiguity errors Edsko de Vries **20080602202001] { hunk ./src/System/Plugins/Env.hs 76 -import Distribution.Package +import Distribution.Package hiding (packageName) hunk ./src/System/Plugins/PackageAPI.hs 43 -import Distribution.Package +import Distribution.Package hiding (depends, packageName) hunk ./src/System/Plugins/ParsePkgConfCabal.hs 9 -import Distribution.Package +import Distribution.Package hiding (depends) } Edsko _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080603/3d54391b/attachment-0001.htm From darrinth at gmail.com Tue Jun 3 10:35:03 2008 From: darrinth at gmail.com (Darrin Thompson) Date: Tue Jun 3 10:27:41 2008 Subject: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1 In-Reply-To: <20080601184446.GA27750@zombie.inf.tu-dresden.de> References: <20080601184446.GA27750@zombie.inf.tu-dresden.de> Message-ID: On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer wrote: > Hi, > > I'm pleased to announce yet another tool for importing darcs repositories > to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in > Haskell, on top of the darcs2 source code. The result is a much faster > program - it can convert the complete ghc 6.9 branch (without libraries) > in less than 15 minutes on my slightly dated machine (Athlon XP 2500+), > which is quite fast [3]. Incremental updates work, too. > What's the appeal of this? I personally love git, but I thought all the cool kids at this school used darcs and that was that. -- Darrin From devriese at cs.tcd.ie Tue Jun 3 10:35:16 2008 From: devriese at cs.tcd.ie (Edsko de Vries) Date: Tue Jun 3 10:27:56 2008 Subject: [Haskell-cafe] hs-plugins compile error In-Reply-To: References: <20080602192332.GB24905@netsoc.tcd.ie> Message-ID: <20080603143515.GB17501@netsoc.tcd.ie> On Tue, Jun 03, 2008 at 03:07:33PM +0100, John O'Donnell wrote: > Hi, > > What is the status of hs-plugins? I recently tried to install the > version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9 > and ghc-6.8.2, but didn't get past the configure stage (see config.log > below). > > The installation script is invoking gcc with a -V command line argument > but according to gcc documentation -V requires an argument. > > Has anyone managed to get hs-plugins to work? If so, what platform, > which version of ghc and gcc, and where did you find the hs-plugins > source? It's working fine for me (after applying the patch I submitted), on Debian Lenny (which currently comes with ghc 6.8.2, gcc 4.2.4) and the source from Hackage. Source from the darcs repository also works fine (after applying the same patch). I *am* getting an application crash sometimes when I close my application, but I have not yet been able to track that down so I'm not 100% sure it's due to hs-plugins. Edsko From jtod at dcs.gla.ac.uk Tue Jun 3 10:49:06 2008 From: jtod at dcs.gla.ac.uk (John O'Donnell) Date: Tue Jun 3 10:41:45 2008 Subject: [Haskell-cafe] hs-plugins compile error References: <20080602192332.GB24905@netsoc.tcd.ie> <20080603143515.GB17501@netsoc.tcd.ie> Message-ID: Thanks, Edsko. My version of gcc is 4.3.0. It may well be that some other piece of software in the Fedora 9 distribution is incompatible with the hs-plugins installation script. Has anyone installed hs-plugins on Fedora? I was able to get it to compile on Fedora 4, using ghc-6.4, two or three years ago, but it's never worked on any of my systems since then. John -----Original Message----- From: Edsko de Vries [mailto:devriese@cs.tcd.ie] Sent: Tue 2008-06-03 15:35 To: John O'Donnell Cc: Edsko de Vries; Don Stewart; haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] hs-plugins compile error On Tue, Jun 03, 2008 at 03:07:33PM +0100, John O'Donnell wrote: > Hi, > > What is the status of hs-plugins? I recently tried to install the > version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9 > and ghc-6.8.2, but didn't get past the configure stage (see config.log > below). > > The installation script is invoking gcc with a -V command line argument > but according to gcc documentation -V requires an argument. > > Has anyone managed to get hs-plugins to work? If so, what platform, > which version of ghc and gcc, and where did you find the hs-plugins > source? It's working fine for me (after applying the patch I submitted), on Debian Lenny (which currently comes with ghc 6.8.2, gcc 4.2.4) and the source from Hackage. Source from the darcs repository also works fine (after applying the same patch). I *am* getting an application crash sometimes when I close my application, but I have not yet been able to track that down so I'm not 100% sure it's due to hs-plugins. Edsko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080603/daad2cb7/attachment.htm From loup.vaillant at gmail.com Tue Jun 3 10:57:02 2008 From: loup.vaillant at gmail.com (Loup Vaillant) Date: Tue Jun 3 10:49:40 2008 Subject: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1 In-Reply-To: References: <20080601184446.GA27750@zombie.inf.tu-dresden.de> Message-ID: <6f9f8f4a0806030757y142f0710lb05754429e4b6515@mail.gmail.com> 2008/6/3 Darrin Thompson : > On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer > wrote: >> Hi, >> >> I'm pleased to announce yet another tool for importing darcs repositories >> to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in >> Haskell, on top of the darcs2 source code. The result is a much faster >> program - it can convert the complete ghc 6.9 branch (without libraries) >> in less than 15 minutes on my slightly dated machine (Athlon XP 2500+), >> which is quite fast [3]. Incremental updates work, too. >> > > What's the appeal of this? I personally love git, but I thought all > the cool kids at this school used darcs and that was that. Disclaimer: I'm no expert, this is what I've heard. Anyone please confirm or deny the following? Basically, git is waaay faster than Darcs on a number of use cases. So, maybe the point of using this converter is when you just cannot use Darcs any more (too old/big project, merging huge branch with loads of conflicts, I don't know). Another point may be "broadcast-ability": It is possible to expose two repositories: one Darcs, one Git. If I use Git and not Darcs (please don't sue me), it will be simpler for me to get the source from the Git snapshot, provided there is one. Well, if I want to contribute back... maybe I should switch. I think the True Heresy (and most useful, if practical) would be to convert back and forth between the two version control systems, accepting patches from both :-) Loup From darrinth at gmail.com Tue Jun 3 11:53:07 2008 From: darrinth at gmail.com (Darrin Thompson) Date: Tue Jun 3 11:45:45 2008 Subject: [Haskell-cafe] Rewrite class with fundeps in pure h98? Message-ID: I thought that I should be able to write something like the toHtml function below with pure H98, but when I went to write it I ended up needing fundeps. Is there a way to express this without using any extensions? The idea was to take a remotely Dom-like tree and flatten it into a string, but not require any particular string type. Mostly I'm ripping off HStringTemplate for the fun of it. {-# OPTIONS -fglasgow-exts #-} module Control.WebWidget where import Data.Monoid import Data.String data (IsString s, Monoid s) => Dom s = Element s [Attr s] [Dom s] | Text s data (IsString s, Monoid s) => Attr s = Attr s s class (Monoid s, IsString s) => HTML d s | d -> s where toHtml :: d -> s instance (Monoid s, IsString s) => HTML (Dom s) s where toHtml (Element name attrs children) = mconcat [ fromString "<", name, mconcat $ map toHtml attrs, fromString ">", mconcat $ map toHtml children, fromString "" ] toHtml (Text s) = s instance (Monoid s, IsString s) => HTML (Attr s) s where toHtml (Attr key value) = mconcat [ fromString " '", key, fromString "'='", value, fromString "' " ] -- Darrin From isaacdupree at charter.net Tue Jun 3 11:56:55 2008 From: isaacdupree at charter.net (Isaac Dupree) Date: Tue Jun 3 11:49:43 2008 Subject: [Haskell-cafe] Implementing ParseChart with Data.Map In-Reply-To: <1212445709.15010.144.camel@localhost> References: <1212445709.15010.144.camel@localhost> Message-ID: <484569C7.7090602@charter.net> Duncan Coutts wrote: > modify :: k -> Map k e -> (e, Maybe e -> Map k e) > > so it's a lookup that returns the element at k and also a continuation > that lets you rebuild a new map with an altered element. I guess that > doesn't account for the element not existing. There's probably a > generalisation that does. isn't it just adding the necessary Maybe?: modify :: k -> Map k e -> (Maybe e, Maybe e -> Map k e) ? -Isaac From phercek at gmail.com Tue Jun 3 12:42:44 2008 From: phercek at gmail.com (Peter Hercek) Date: Tue Jun 3 12:35:33 2008 Subject: [Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1 In-Reply-To: <6f9f8f4a0806030757y142f0710lb05754429e4b6515@mail.gmail.com> References: <20080601184446.GA27750@zombie.inf.tu-dresden.de> <6f9f8f4a0806030757y142f0710lb05754429e4b6515@mail.gmail.com> Message-ID: Loup Vaillant wrote: > 2008/6/3 Darrin Thompson : >> <--cut--> >> What's the appeal of this? I personally love git, but I thought all >> the cool kids at this school used darcs and that was that. > > Disclaimer: I'm no expert, this is what I've heard. Anyone please > confirm or deny the following? > > Basically, git is waaay faster than Darcs on a number of use cases. Other reason can be "git rebase". Of course there is a question how good practice it is ... but it is being used. Peter. From tphyahoo at gmail.com Tue Jun 3 13:08:19 2008 From: tphyahoo at gmail.com (Thomas Hartman) Date: Tue Jun 3 13:00:59 2008 Subject: [Haskell-cafe] ANN (2 Libs) -- hvac 0.1b, a lightweight web framework and HStringTemplate 0.3 In-Reply-To: References: Message-ID: <910ddf450806031008u4f3432b9hcaf26ca388fdad81@mail.gmail.com> I just tried out hvac. I was trying to run the hvac examples after following the readme in the samples directory. sudo lighttpd -D -f lh.conf [sudo] password for thartman: 2008-06-03 09:30:02: (log.c.75) server started so that's okay, but http://localhost:3000/hvac-board/board/1 in firefox attempted to open a binary file "1". Same result for http://localhost:3000/hvac-board I don't know if this is an hvac issue or a fastcgi issue (seems more likely) but any advice? Thomas. 2008/3/22 Sterling Clover : > 1) hvac 0.1b: transactional, declarative framework for lightweight web > applications. > 2) HStringTemplate 0.3 > > 1) hvac 0.1b > > hvac (short for http view and controller) has been my project for the last > little while, and is finally in a fairly usable state, so I'm opening up the > repo (darcs get http://community.haskell.org/~sclv/hvac/) for folks to play > with and to get some feedback. While not quite yet ready for hackage, the > package as provided should be fully cabal installable. Documentation is > available at http://community.haskell.org/~sclv/hvac/html_docs/hvac/ > > The aim of hvac is to provide an environment that makes the creation of > lightweight fastcgi based web applications as simple as possible, with an > emphasis on concise, declarative style code, correct concurrent > transactional logic, and transparency in adding caching combinators. > > There are two included example programs, naturally neither of which is > feature complete. They share a common login module of about 50 lines of > code, excluding imports, templates, and database schema. > > The first program is a classic, greenspun-style message board with basic > login functionality. It totals roughly 40 lines and tends to use just under > 4mb of resident memory on my system. > > The second is a wiki based on Pandoc and the PandocWiki code. The code > totals roughly 30 lines (rendering borrowed from PandocWiki aside) and uses > about 5mb of memory. > > hvac processes all requests in the STM monad, with some bells attached to > properly interleave STM with session, database and filesystem operations > such that they all conceptually occur together in a single transaction per > request. Currently it is only fully tested with sqlite, but it should > operate, modulo a few tweaks, with any database accessible via HDBC. > > hvac is particularly designed to use the HStringTemplate library as an > output layer, in a simple declarative fashion. As the StringTemplate grammar > is explicitly sub-turing, this ensures a clean separation of program logic > from presentation, while providing a nonetheless fairly powerful language to > express typical display tasks. > > The included cache combinators, still experimental, should allow a simple > and fine-grained control over the level of caching of various disk-bound > operations. Phantom types are used to ensure that no functions that modify > state may be cached. > > To give a flavor of hvac code, the following is the complete (twenty lines!) > source of the wiki controller (due to sql statements, some lines are rather > long): > > wikiController tmpl = > h |/ "login" *> login_plug tmpl > <|> > (h |/ "wiki" |\\ \pageName -> h |// "POST" *> > withValidation [ ("contents", return) ] > (\ [contents] -> do > pageId <- selectVal "id from pages where name=?" [toSql > pageName] > maybe (addErrors [("Login","must be logged in.")] >> continue) > (\user -> case fromSql pageId of > Just (_::Int) -> > execStat "insert into > page_hist(pageId,contents,author) values(?,?,?)" [pageId, toSql contents, > toSql . userName $ user] > Nothing -> do > execStat "insert into pages(name,locked) > values(?,?)" [toSql pageName, toSql (0::Int)] > pid <- selectVal "max(id) from pages" [] > execStat "insert into > page_hist(pageId,contents,author) values(?,?,?)" [pid, toSql contents, toSql > . userName $ user]) =<< getSes > continue) > <|> do > pageId <- selectVal "id from pages where name=?" [toSql pageName] > (join $ renderf (tmpl "showPage") ("pageName", pageName) > <$> "pageContents" |= selectRow "* from page_hist where > pageId=? order by time desc limit 1" [pageId] )) > <|> (redirect . ( ++ "/wiki/Index") =<< scriptName) > > Future directions for work on hvac include: Stress testing for correctness > of transactional logic and benchmarks. Exploration of various efficiency > tweaks. Unit tests. Further development of the cache combinator API. > Improvement of the example apps and addition of a few others (a blog maybe). > Expansion of the library of validator functions. Exploration of transferring > hvac to the standard FastCGI bindings (currently it uses a custom modified > version to work properly with STM). Improvement of the database layer, > particularly with regards to common paging functions. Creation of a set of > simple combinators for generating CRUD (create read update delete) pages. > Creation of a minimal set of standard templates (maybe). > > 2) HStringTemplate 0.3.1 > > This release of HStringTemplate (up now at Hackage) fixes a number of bugs > pointed out to me by its small but growing user base (thanks, cinema, > elliottt!) ranging from the minor (a particular two-level iteration pattern > wasn't working properly) to the truly irritating (poor handling of file > groups). It's still unfortunately skimpy on the docs, outside of the > haddocks and the main StringTemplate grammar documentation at > http://www.stringtemplate.org (although the examples from hvac should also > prove helpful). However, it does have a set of very nice and handy new > features for development. > > * renderf, a function similar in spirit to printf, that takes an arbitrary > number of heterogeneous (String, value) tuples as arguments. This should cut > down considerably on long setAttribute chains. Additionally, with custom > instances (not, I'll grant, trivial to write) it can be used to > declaratively chain together strings of attribute retrieval functions in > arbitrary monads, as in the above code example from hvac. > > * dumpAttribs, a function/template that prints out the tree of the entire > attribute environment a template is operating in -- extremely handy for > development. > > * nullGroup, also for use in development, a simple way to display more > information about templates that can't be found. Error messages in > usafeVolatileDirectoryGroup have also been significantly improved. > > * getStringTemplate', a version of getStringTemplate guaranteed not to be > inlined. While the optimizer will still sometimes rearrange code such that a > volatile group is not updated properly, this at least helps remedy the > situation (I think). > > * Some minor changes: For grammar reasons, dots have been removed from > template names -- however, underscores and slashes are now available. > Additionally, there's a much improved logic for which aspects of a local > environment are overridden and preserved when a template is called from > another. > > For both of these libraries, patches, comments, bug reports, requests, and > of course contributions more than welcome! > > Regards, > Sterl._______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From wnoise at ofb.net Tue Jun 3 13:15:47 2008 From: wnoise at ofb.net (Aaron Denney) Date: Tue Jun 3 13:08:32 2008 Subject: [Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1 References: <20080601184446.GA27750@zombie.inf.tu-dresden.de> <6f9f8f4a0806030757y142f0710lb05754429e4b6515@mail.gmail.com> Message-ID: On 2008-06-03, Peter Hercek wrote: > Loup Vaillant wrote: >> 2008/6/3 Darrin Thompson : >>> <--cut--> >>> What's the appeal of this? I personally love git, but I thought all >>> the cool kids at this school used darcs and that was that. >> >> Disclaimer: I'm no expert, this is what I've heard. Anyone please >> confirm or deny the following? >> >> Basically, git is waaay faster than Darcs on a number of use cases. > > Other reason can be "git rebase". Of course there is a question > how good practice it is ... but it is being used. Darcs patches are pretty much an implicit rebase. -- Aaron Denney -><- From apfelmus at quantentunnel.de Tue Jun 3 13:17:45 2008 From: apfelmus at quantentunnel.de (apfelmus) Date: Tue Jun 3 13:10:34 2008 Subject: [Haskell-cafe] Re: Rewrite class with fundeps in pure h98? In-Reply-To: References: Message-ID: Darrin Thompson wrote: > I thought that I should be able to write something like the toHtml > function below with pure H98, but when I went to write it I ended up > needing fundeps. Is there a way to express this without using any > extensions? > > The idea was to take a remotely Dom-like tree and flatten it into a > string, but not require any particular string type. > > data (IsString s, Monoid s) => Dom s = > Element s [Attr s] [Dom s] | > Text s > > data (IsString s, Monoid s) => Attr s = Attr s s > > class (Monoid s, IsString s) => HTML d s | d -> s where > toHtml :: d -> s > > instance (Monoid s, IsString s) => HTML (Dom s) s