Re: [Haskell-cafe] Cont, ContT and IO()

2009-07-04 Thread Bulat Ziganshin
Hello Günther, Saturday, July 4, 2009, 3:11:23 AM, you wrote: I've got an IO action, some file system IO, traversing one level only and iterating over files found. I wish to build in an early exit, ie. if an IO action in the loop encounters a particular value I want it to abort the loop.

[Haskell-cafe] following up on space leak

2009-07-04 Thread Uwe Hollerbach
Good evening, all, following up on my question regarding space leaks, I seem to have stumbled across something very promising. I said I was using this tiny function lastOrNil to get the last value in a list, or the empty (scheme) list if the haskell list was empty. The uses of it were all of the

Re: [Haskell-cafe] Cabal fun [Half-integer]

2009-07-04 Thread Andrew Coppin
Antoine Latter wrote: Personally, I've never used runhaskell Setup sdist and I've only ever used cabal sdist. But I'm not sure where I learned that. I think cabal-install is a pretty standard util for people to have, and it ships with the Haskell platform now. So the big hurdle is

Re: [Haskell-cafe] following up on space leak

2009-07-04 Thread Marcin Kosiba
On Saturday 04 July 2009, Uwe Hollerbach wrote: Good evening, all, following up on my question regarding space leaks, I seem to have stumbled across something very promising. I said I was using this tiny function lastOrNil to get the last value in a list, or the empty (scheme) list if the

Re: [Haskell-cafe] ORM for haskell?

2009-07-04 Thread Alberto G. Corona
And I realize that you are not trying to replace RDBs, just building a nicer interface to them. I am just concerned that some of the nice properties are lost in the process. I think my main concern comes from seeing people create databases, by automatically generating tables from OO-classes.

[Haskell-cafe] ANN: HalfInteger-1.1.1

2009-07-04 Thread Andrew Coppin
Andrew Coppin wrote: I just wrote a small module for dealing with half-integers. (That is, any number I/2 where I is an integer. Note that the set of integers is a subset of this; Wikipedia seems to reserve half-integer for such numbers that are *not* integers.) Now, the question is... Is

Re: [Haskell-cafe] ANN: HalfInteger-1.1.1

2009-07-04 Thread Felipe Lessa
On Sat, Jul 04, 2009 at 12:37:21PM +0100, Andrew Coppin wrote: It's on Hackage: http://hackage.haskell.org/package/AC-HalfInteger-1.1.1 It'll be interesting to see if I uploaded it right... o_O I guess you did, congrats! :) ...on the Haddock comments of halve and double, it should be

Re: [Haskell-cafe] ANN: HalfInteger-1.1.1

2009-07-04 Thread Andrew Coppin
Felipe Lessa wrote: On Sat, Jul 04, 2009 at 12:37:21PM +0100, Andrew Coppin wrote: It's on Hackage: http://hackage.haskell.org/package/AC-HalfInteger-1.1.1 It'll be interesting to see if I uploaded it right... o_O I guess you did, congrats! :) ...on the Haddock comments of halve

Re: [Haskell-cafe] Monoid wants a (++) equivalent

2009-07-04 Thread Brandon S. Allbery KF8NH
On Jul 4, 2009, at 01:17 , Jason Dusek wrote: What is the proper name for the operation on functions of a functor, anyway? The name `fmap` seems to driven by an analogy with `map`. Cale (.) /Cale -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system

[Haskell-cafe] Small Haddock question

2009-07-04 Thread Andrew Coppin
This is irritating me now... Suppose I have something like the following: zero = 0 :: Int one = 1 :: Int two = 2 :: Int three = 3 :: Int How do I add Haddock comments to the end of each line? For some reason, Haddock doesn't like either of zero = 0 :: Int -- | Zero zero = 0 :: Int -- ^ Zero

Re: [Haskell-cafe] Cont, ContT and IO()

2009-07-04 Thread Matthias Görgens
process [] = return () process (file:files) = do x - doit file                          if x0 then process files                                 else return () Or use a fold: process' = foldl op True files op True file = doit file op False _ = False

Re: [Haskell-cafe] Cont, ContT and IO()

2009-07-04 Thread Matthias Görgens
process' = foldl op True files op True file = doit file op False _ = False Please pardon me. 'doit' should surely be able to do some IO: import Data.Foldable import System.IO process' = foldlM op True files op True file = doit file op False _ = return False were DoIt has the type

Re[2]: [Haskell-cafe] Cont, ContT and IO()

2009-07-04 Thread Bulat Ziganshin
Hello Matthias, Saturday, July 4, 2009, 6:39:30 PM, you wrote: Or use a fold: process' = foldl op True files op True file = doit file op False _ = False foldM, probably, otherwise you will need to execute all actions before running fold -- Best regards, Bulat

[Haskell-cafe] Re: Cont, ContT and IO() - Code on hpaste

2009-07-04 Thread Günther Schmidt
Hi, I've put the code that I wish to transform from using exceptions to using continuations on hpaste: ?http://hpaste.org/fastcgi/hpaste.fcgi/view?id=6515#a6515 thanks Günther Am 04.07.2009, 01:11 Uhr, schrieb Günther Schmidt gue.schm...@web.de: Hi, I've got an IO action, some file

Re: [Haskell-cafe] Re: Cont, ContT and IO() - Code on hpaste

2009-07-04 Thread Matthias Görgens
Hi Günther, here is a solution with the Maybe Monad: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=6515#a6515 Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Cont, ContT and IO() - Code on hpaste

2009-07-04 Thread Matthias Görgens
P.S. See http://en.wikibooks.org/wiki/Haskell/Monad_transformers for some documentation. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Cont, ContT and IO() - Code on hpaste

2009-07-04 Thread Matthias Görgens
P.P.S. Strange it does not seem to work with the paste. So here comes the solution by mail: module Consolidator.BusinessLogic.ConflictsResolved (consolidateDuplicates) where import System.FilePath import System.Directory import Control.Monad (filterM) import Control.Exception (throwIO) import

[Haskell-cafe] Haskell Weekly News: Issue 124 - July 4, 2009

2009-07-04 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090704 Issue 124 - July 04, 2009 --- Welcome to issue 124 of HWN, a newsletter covering

Re: [Haskell-cafe] Small Haddock question

2009-07-04 Thread Denis Bueno
On Sat, Jul 4, 2009 at 08:22, Andrew Coppinandrewcop...@btinternet.com wrote: This is irritating me now... Suppose I have something like the following: zero = 0 :: Int one = 1 :: Int two = 2 :: Int three = 3 :: Int How do I add Haddock comments to the end of each line? For some reason,

[Haskell-cafe] Flow Graphs for Language-independent Code Representation

2009-07-04 Thread Cetin Sert
Hi *^o^*, I'm working on a source code transformation project for numerical automatic differentiation for Fortran and C. I would love to know the best Haskell way/package available today to represent procedural (non-OO) code in a language-independent manner. Any tips or resource, paper

Re: [Haskell-cafe] ANN: HalfInteger-1.1.1

2009-07-04 Thread Andrew Coppin
Alexander Dunlap wrote: Couple of suggestions: - You should put an (Integer i) = constraint on the halve function so that it becomes impossible to create invalid HalfIntegers. Right. Currently you can *make* such a HalfInteger. You just won't be able to *do* anything with it afterwards.

[Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Andrew Coppin
OK, so having released AC-HalfInteger, I got slightly carried away and released three other small packages. These are packages that many programs I write all end up using. I'm forever copying these files, so I made them into actual bonafide packages.

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Felipe Lessa
On Sat, Jul 04, 2009 at 06:56:44PM +0100, Andrew Coppin wrote: http://hackage.haskell.org/package/AC-Colour-1.1.1 Why don't you use colour[1]? [1] http://hackage.haskell.org/package/colour -- Felipe. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Andrew Coppin
Felipe Lessa wrote: On Sat, Jul 04, 2009 at 06:56:44PM +0100, Andrew Coppin wrote: http://hackage.haskell.org/package/AC-Colour-1.1.1 Why don't you use colour[1]? [1] http://hackage.haskell.org/package/colour A few reasons: 1. I never knew it existed. ;-) 2. It's

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Max Rabkin
On Sat, Jul 4, 2009 at 8:38 PM, Andrew Coppinandrewcop...@btinternet.com wrote: A few reasons: 1. I never knew it existed. ;-) A good reason. However, it's good to do a quick search over Hackage before uploading (or before writing) so you know what's out there. Also, if you hadn't used an AC-

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Andrew Coppin
Max Rabkin wrote: On Sat, Jul 4, 2009 at 8:38 PM, Andrew Coppinandrewcop...@btinternet.com wrote: A few reasons: 1. I never knew it existed. ;-) A good reason. However, it's good to do a quick search over Hackage before uploading (or before writing) so you know what's out there.

Re: [Haskell-cafe] following up on space leak

2009-07-04 Thread Uwe Hollerbach
On 7/4/09, Marcin Kosiba marcin.kos...@gmail.com wrote: On Saturday 04 July 2009, Uwe Hollerbach wrote: Good evening, all, following up on my question regarding space leaks, I seem to have stumbled across something very promising. I said I was using this tiny function lastOrNil to get the last

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Max Rabkin
On Sat, Jul 4, 2009 at 9:18 PM, Andrew Coppinandrewcop...@btinternet.com wrote: 2. It's mind-blowingly complex. Colour *is* complex. Which is why I'm so glad Russell O'Connor did all the hard work for me :) Well, no, because now I'm going to have to spend a few hours trying to find out

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Andrew Coppin
Paul Johnson wrote: Andrew Coppin wrote: Well, no, because now I'm going to have to spend a few hours trying to find out what CIE is before I can even use that library. I think really it's just aimed at a different problem. It looks like it's trying to specify actual real-world colours.

[Haskell-cafe] Optimizing Compiler for the ICFP 09 contest's VM

2009-07-04 Thread Matthias Görgens
The byte code for the virtual machine of this years ICFP specified a language with single assignment per simulation step. Interestingly most memory locations get overwritten each simulation step before they are read. That means, those locations don't have to be remember between steps. Also

Re: [Haskell-cafe] Optimizing Compiler for the ICFP 09 contest's VM

2009-07-04 Thread minh thu
2009/7/4 Matthias Görgens matthias.goerg...@googlemail.com: The byte code for the virtual machine of this years ICFP specified a language with single assignment per simulation step. Interestingly most memory locations get overwritten each simulation step before they are read. That means,

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Brandon S. Allbery KF8NH
On Jul 4, 2009, at 15:01 , Max Rabkin wrote: On Sat, Jul 4, 2009 at 8:38 PM, Andrew Coppinandrewcop...@btinternet.com wrote: 3. It doesn't appear to provide arithmetic over colours. It provides darken, blend and addition (though addition is called mappend rather than (+)). signum, abs and