Re: [Haskell-cafe] Memoization/call-by-need

2010-09-20 Thread Henning Thielemann
Alex Rozenshteyn schrieb: I feel that there is something that I don't understand completely: I have been told that Haskell does not memoize function call, e.g. slowFib 50 will run just as slowly each time it is called. However, I have read that Haskell has call-by-need semantics, which were

Re: [Haskell-cafe] Introducing The Monads Presentation Slides

2010-09-20 Thread Henning Thielemann
Matthias Kilian schrieb: On Fri, Sep 17, 2010 at 12:54:29PM -0500, aditya siram wrote: Slides shared and Reddited! Feedback is very welcome! http://www.reddit.com/r/haskell/comments/dfazp/introducing_the_monads_a_practical_tour_of/ Oh, come on. A site where you need a flash player to

Re: [Haskell-cafe] Ultra-newbie Question

2010-09-20 Thread Henning Thielemann
Christopher Tauss schrieb: I am a professional programmer with 11 years experience, yet I just do not seem to be able to get the hang of even simple things in Haskell. I am trying to write a function that takes a list and returns the last n elements. Looking through the glasses of lazy

Re: [Haskell-cafe] Ultra-newbie Question

2010-09-20 Thread Henning Thielemann
Luke Palmer schrieb: I think this is O(n) time, O(1) space (!). lastk :: Int - [a] - [a] lastk k xs = last $ zipWith const (properTails xs) (drop k xs) where properTails = tail . tails If (drop k xs) is empty, this yields an error when calling 'last'. This might be a bug or a feature.

Re: [Haskell-cafe] Idea for hackage feature

2010-09-16 Thread Henning Thielemann
Ivan Lazar Miljenovic schrieb: On 16 September 2010 16:04, Mitar mmi...@gmail.com wrote: Hi! I just got an idea for hackage feature. All functions/modules listed there could have some mark if they or any function/module they use uses an unsafe* function. Of course this will make probably

Re: [Haskell-cafe] Disable LINE Pragma handling in GHC

2010-09-13 Thread Henning Thielemann
JP Moresmau schrieb: Users may not want to edit the files directly, but they'll be happy to be able to open them with proper syntax highlighting, for example. Sure, but is showing the line numbers of the original file a bug or a feature? ___

Re: [Haskell-cafe] ANN: ecu-0.0.0

2010-09-13 Thread Henning Thielemann
Brandon S Allbery KF8NH schrieb: On 9/11/10 13:46 , Henning Thielemann wrote: Would it be better to write canlib in a way that works on both Windows and Unix? Otherwise all packages that import canlib have to add this switch. The phrasing of the original request leads me to believe

Re: [Haskell-cafe] Do expression definition

2010-09-13 Thread Henning Thielemann
On Mon, 13 Sep 2010, Alexander Kotelnikov wrote: Hello. http://www.haskell.org/onlinereport/exps.html#sect3.14 a obscure (to me) note which says As indicated by the translation of do, variables bound by let have fully polymorphic types while those defined by - are lambda bound and are thus

Re: [Haskell-cafe] Re: Do expression definition

2010-09-13 Thread Henning Thielemann
On Mon, 13 Sep 2010, Gleb Alexeyev wrote: On 09/13/2010 12:38 PM, Thomas Davie wrote: There's no later here at all. Two seperate definitions in a Haskell program act as if they have always been defined, are defined, and always will be defined, they are not dealt with in sequence (except

Re: [Haskell-cafe] Cost: (:) vs head

2010-09-12 Thread Henning Thielemann
michael rice schrieb: Which of these would be more costly for a long list? f :: [Int] - [Int] f [x] = [x] f (x:xs) = x + (head xs) : f xs f :: [Int] - [Int] f [x] = [x] f (x:y:xs) = x + y : f (y:xs) What about empty lists? How about zipWith (+) xs (drop 1 xs ++ [0]) ? Since I often

Re: [Haskell-cafe] ANN: ecu-0.0.0

2010-09-11 Thread Henning Thielemann
Brent Yorgey schrieb: You want conditional configurations in the .cabal file. See http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html#configurations For the OS issue you can do something like if os(windows) Build-depends: canlib-windows else

Re: [Haskell-cafe] ANN: ecu-0.0.0

2010-09-11 Thread Henning Thielemann
Stephen Tetley schrieb: On 10 September 2010 05:11, Tom Hawkins tomahawk...@gmail.com wrote: Another question: Can we get a Hackage category specifically for the use of Haskell in embedded systems? I didn't see anything that stood out. Hi Tom Don't you just pick a category yourself

Re: [Haskell-cafe] record update

2010-09-11 Thread Henning Thielemann
Jonathan Geddes schrieb: I know that record updates is a topic that has become a bit of a dead horse, but here I go anyway: I find that most of the record updates I read and write take the form someUpdate :: MyRecord - MyRecord someUpdate myRecord = myRecord { field1 = f $ field1

Re: [Haskell-cafe] Disable LINE Pragma handling in GHC

2010-09-11 Thread Henning Thielemann
JP Moresmau schrieb: Hello fellow Haskellers, In EclipseFP we use the GHC API for IDE related stuff like syntax highlighting and code outlines. However, I ran into something funny yesterday: when a source file contains LINE pragmas

Re: [Haskell-cafe] record update

2010-09-11 Thread Henning Thielemann
On Sat, 11 Sep 2010, Jonathan Geddes wrote: On Sat, Sep 11, 2010 at 11:53 AM, Henning Thielemann data-accessor and similar packages may become your friends. data-accessor allows you to write: someUpdate =   (field1 ^: f) .   (field2 ^: g) .   (field3 ^: h) data-accessor is a pretty cool

Re: [Haskell-cafe] record update

2010-09-11 Thread Henning Thielemann
On Sat, 11 Sep 2010, Stephen Tetley wrote: On 11 September 2010 18:21, Jonathan Geddes geddes.jonat...@gmail.com wrote: someUpdate :: MyRecord - MyRecord someUpdate myRecord = myRecord     { field1 = f $ field1 myRecord     , field2 = g $ field2 myRecord     , field3 = h $ filed3 myRecord    

Re: [Haskell-cafe] ANNOUNCE: AbortT-transformers version 1.0

2010-09-09 Thread Henning Thielemann
Colin Paul Adams schrieb: Henning == Henning Thielemann lemm...@henning-thielemann.de writes: Henning On Wed, 8 Sep 2010, Gregory Crosswhite wrote: ExceptionT is a different matter because it handles fail as an uncaught error and places no restrictions on the error type, so

Re: [Haskell-cafe] Haskell, arrows and signal processing

2010-09-09 Thread Henning Thielemann
Rafael Gustavo da Cunha Pereira Pinto schrieb: The input and output are infinite streams. I have a few questions: 1) Is it possible to change it to use arrows? How would it look like? 2) How would one implement an continuous time version? For 2) I would like to implement something like

Re: [Haskell-cafe] ANNOUNCE: AbortT-transformers version 1.0

2010-09-08 Thread Henning Thielemann
Gregory Crosswhite schrieb: For whatever reason, nobody seems to have gotten around to implementing an Abort monad transformer (outside the monadLib package), so I decided to write one myself since I wanted the functionality but I use transformers rather than monadLib. Is AbortT different

Re: [Haskell-cafe] ANNOUNCE: GotoT-transformers version 1.0

2010-09-08 Thread Henning Thielemann
Gregory Crosswhite schrieb: People want to believe that Haskell is a better language than C, but how could this possibly be true when Haskell lacks the very basic goto feature??? If the world is going to take Haskell seriously, then this serious blight needs to be addressed immediately!

Re: [Haskell-cafe] ANNOUNCE: AbortT-transformers version 1.0

2010-09-08 Thread Henning Thielemann
On Wed, 8 Sep 2010, Gregory Crosswhite wrote: ExceptionT is a different matter because it handles fail as an uncaught error and places no restrictions on the error type, so one could implement the same functionality as AbortT by using ExceptionalT and requiring the end result be a monadic

Re: [Haskell-cafe] circular imports

2010-09-07 Thread Henning Thielemann
Mathew de Detrich schrieb: I had the same issue zonks ago, and I resorted to using the hs-boot file method as well (which worked fine) Which I guess brings me to my second point, is this something that GHC should do automatically when it sees circular dependencies? When I asked about it

Re: [Haskell-cafe] circular imports

2010-09-07 Thread Henning Thielemann
Simon Peyton-Jones schrieb: I was under the impression that the main reason GHC requires .hs-boot files is that nobody has had the time or inclination to make it resolve circular dependencies automatically, and not an intentional design decision to encourage good design. Indeed. I’ve added

Re: Réf. : [Haskell-cafe] Re: circular imports

2010-09-07 Thread Henning Thielemann
corentin.dup...@ext.mpsa.com schrieb: That sort of code (stripped out): In Game.hs: data Game = Game { ... activeRules :: [Rule]} applyTo :: Rule - Game - Game applyTo r gs = ... In Rule.hs: data Rule = Cond (Obs) Rule Rule | many others..

Re: Réf. : [Haskell-cafe] Re: circular imports

2010-09-07 Thread Henning Thielemann
On Tue, 7 Sep 2010, Johannes Waldmann wrote: Henning Thielemann schlepptop at henning-thielemann.de writes: As I see there is no cycle in the types. How about defining Game, Rule, Obs in private modules, like Private.Game, Private.Rule, Private.Obs, and implementing the functions in public

Re: [Haskell-cafe] How to catch exception within the Get monad (the Binary package)

2010-09-07 Thread Henning Thielemann
Dimitry Golubovsky schrieb: Hi, Thanks to everybody who replied. I see another solution: are there any hidden problems? I found an interesting package, ChasingBottoms which contains a function testing a value to be bottom and returning a Boolean (of course it cannot be done without

Re: [Haskell-cafe] Unnecessarily strict implementations

2010-09-06 Thread Henning Thielemann
Daniel Fischer schrieb: On Sunday 05 September 2010 21:52:44, Henning Thielemann wrote: Daniel Fischer schrieb: Yes. Ordinarily, lines in text files aren't longer than a few hundred characters, leaking those, who cares? I got several space leaks of this kind in the past. They are very

Re: [Haskell-cafe] ANNOUNCE: Haddock version 2.8.0 - HTML vs. XHTML

2010-09-06 Thread Henning Thielemann
Mark Lentczner schrieb: The choice to generate Haddock output as XHTML 1.0 Transitional and Frames, stored into files with an extension of .html, and that would likely be served as text/html, was mine and I did so with review of current best practices. The output Haddock now generates

Re: [Haskell-cafe] overloaded list literals?

2010-09-06 Thread Henning Thielemann
On Mon, 6 Sep 2010, Johannes Waldmann wrote: We have overloaded numerical literals (Num.fromInteger) and we can overload string literals (IsString.fromString), so how about using list syntax ( [], : ) for anything list-like (e.g., Data.Sequence)? My favorite solution would be to throw away

Re: [Haskell-cafe] overloaded list literals?

2010-09-06 Thread Henning Thielemann
On Mon, 6 Sep 2010, Stefan Holdermans wrote: Wolfgang, We should definitely get rid of these Is* class identifiers like IsString and IsList. We also don’t have IsNum, IsMonad, etc. I see your point. For strings, however, there was of course never the possibility to dub the class String as

Re: [Haskell-cafe] circular imports

2010-09-06 Thread Henning Thielemann
On Mon, 6 Sep 2010, Evan Laforge wrote: I have a few techniques to get out: - Replace Things with ThingIds which have no big dependencies, and can then be looked up in a Map later. This replaces direct access with lookup and thows some extra Maybes in there, which is not very nice. -

Re: [Haskell-cafe] How to catch exception within the Get monad (the Binary package)

2010-09-05 Thread Henning Thielemann
On Sun, 5 Sep 2010, Dimitry Golubovsky wrote: Hi, The following function* is supposed to decode a list of some serialized objects following each other in a lazy Bytestring: many :: Get a - Get [a] many prs = many' [] where many' a = do s - prs r - isEmpty case r of True -

Re: [Haskell-cafe] variable definition according to input

2010-09-05 Thread Henning Thielemann
On Sun, 5 Sep 2010, Maria Merit wrote: Hello,   Is it possible to define variable names according to input data? For instance:   input = I k    = Int k input = I m= Int m input = S s    = String s No this is not possible. However you can use Data.Map String Object with data Object =

Re: [Haskell-cafe] Unnecessarily strict implementations

2010-09-05 Thread Henning Thielemann
Daniel Fischer schrieb: Yes. Ordinarily, lines in text files aren't longer than a few hundred characters, leaking those, who cares? I got several space leaks of this kind in the past. They are very annoying. They are especially annoying if input comes from the outside world, where people can

[Haskell-cafe] Ord instances (Was: Unnecessarily strict implementations)

2010-09-05 Thread Henning Thielemann
Neil Brown schrieb: On 03/09/10 11:11, Henning Thielemann wrote: E.g. I wanted to have a Set of Gaussian (complex) integers, but I did not want to define an Ord instance for them, because writing a (b :: Gaussian) is a bug with high probability. Isn't this what newtype is good

Re: [Haskell-cafe] Unnecessarily strict implementations

2010-09-03 Thread Henning Thielemann
Ivan Lazar Miljenovic schrieb: On 3 September 2010 04:57, Arie Peterson ar...@xs4all.nl wrote: On Thu, 2 Sep 2010 19:30:17 +0200, Daniel Fischer daniel.is.fisc...@web.de wrote: Why would one consider using Ord for Map an abuse? A kludge, for performance reasons, but an abuse? Because it

[Haskell-cafe] Ord instance of Bool (Was: Unnecessarily strict implementations)

2010-09-03 Thread Henning Thielemann
Henning Thielemann schrieb: Ivan Lazar Miljenovic schrieb: On 3 September 2010 04:57, Arie Peterson ar...@xs4all.nl wrote: On Thu, 2 Sep 2010 19:30:17 +0200, Daniel Fischer daniel.is.fisc...@web.de wrote: Why would one consider using Ord for Map an abuse? A kludge, for performance reasons

[Haskell-cafe] Ord instance of Bool (Was: Unnecessarily strict implementations)

2010-09-03 Thread Henning Thielemann
Ivan Lazar Miljenovic schrieb: On 3 September 2010 16:49, Henning Thielemann schlepp...@henning-thielemann.de wrote: You might object, that it is seldom, that someone intentionally writes (ab) if 'a' and 'b' are complex numbers. However imagine someone rewrites an algorithm for real numbers

Re: [Haskell-cafe] Announce: lhae

2010-09-03 Thread Henning Thielemann
Pierre-Etienne Meunier schrieb: Seems cool, but I do not really get it : why write it in haskell ? I thought at first that your formula language was haskell, but it looks more like a php derivative. Does it do more than the spreadsheet thing in openoffice ? Also, maybe you could do the

Re: [Haskell-cafe] Unnecessarily strict implementations

2010-09-02 Thread Henning Thielemann
Jan Christiansen schrieb: Hi, On 02.09.2010, at 01:35, Daniel Fischer wrote: It's not that it's not as non-strict as possible per se. (Sorry, had to :) It's that intersperse's current definition (in GHC at least) can cause a space leak. In this case, making the function less strict can

Re: [Haskell-cafe] Unnecessarily strict implementations

2010-09-02 Thread Henning Thielemann
On Thu, 2 Sep 2010, Stephen Sinclair wrote: On Thu, Sep 2, 2010 at 3:25 AM, Jan Christiansen j...@informatik.uni-kiel.de wrote: I prefer  False = _|_ = True Sorry to go a bit off topic, but I find it funny that I never really noticed you could perform less-than or greater-than comparisons

Re: [Haskell-cafe] Hugs Haskore loading

2010-08-21 Thread Henning Thielemann
On Sat, 21 Aug 2010, Hans Aberg wrote: When trying to load Haskore in Hugs Sept 2006 (say by :l), it does not work because it is in a subdirectory Haskore/Src/, despite that the Hugs searchpath includes /usr/local/lib/hugs/packages/* I could of course change this searchpath, but I'm curios

Re: [Haskell-cafe] Hugs Haskore loading

2010-08-21 Thread Henning Thielemann
On Sat, 21 Aug 2010, Hans Aberg wrote: On 21 Aug 2010, at 20:24, Henning Thielemann wrote: Did you install Haskore with Cabal or is it a version of Haskore that is shipped with Hugs? It is the version that comes with Hugs. It is the same as listed on http://haskell.org/haskore/. What

Re: [Haskell-cafe] Hugs Haskore loading

2010-08-21 Thread Henning Thielemann
On Sat, 21 Aug 2010, Hans Aberg wrote: On 21 Aug 2010, at 20:57, Henning Thielemann wrote: and one that I have messed http://hackage.haskell.org/package/haskore What changes have you made? - perhaps the packages should be unified. I changed almost everything: Divided modules, designed

Re: [Haskell-cafe] Re: cabal, haddock, hscolour

2010-08-19 Thread Henning Thielemann
Ivan Lazar Miljenovic schrieb: Johannes Waldmann waldm...@imn.htwk-leipzig.de writes: Duncan Coutts duncan.coutts at googlemail.com writes: Your .cabal file probably does not list the other-modules as it should, so Cabal does not know that the other modules exist. Ah. Strange though

Re: [Haskell-cafe] Slightly humorous: Headhunters toolbox (example for Germany)

2010-08-17 Thread Henning Thielemann
Daniel Kahlenberg schrieb: Hi list, stumbled across that: http://www.google.com/insights/search/?hl=de#q=haskellgeo=DEcmpt=q Good to know that Saxony-Anhalt is the state in Germany with leading interest in Haskell. :-) I would like to know, whether this is due to Magdeburg or Halle.

Re: [Haskell-cafe] Re: Slightly humorous: Headhunters toolbox (example for Germany)

2010-08-17 Thread Henning Thielemann
On Tue, 17 Aug 2010, Ertugrul Soeylemez wrote: Saxony-Anhalt is the state in Germany with leading number of Google searches regarding Haskell. This tells nothing about interest. It could just as well mean that people in other states understand Haskell better or go to the proper website

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-10 Thread Henning Thielemann
about functional programming jobs in investment banking ... Ketil Malde schrieb: Tom Hawkins tomahawk...@gmail.com writes: (Yes, I realize that's were the money is [...]) Exactly. I don't think this is bad: having talented people recruited to work on functional programming will improve

Re: [Haskell-cafe] What is -

2010-08-08 Thread Henning Thielemann
On Sun, 8 Aug 2010, michael rice wrote: So, Example 2 desugared becomes... [1..] == \z -  ? Yes, [1..] = \z - ... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] What is -

2010-08-08 Thread Henning Thielemann
On Sun, 8 Aug 2010, michael rice wrote: That was my suspicion. So, you can't change horses (monads) in mid-stream. A parallel question: main = do ...    -- in the IO monad I know I can have other *do*s in main,   if foo     then do       .       .     else do      .

Re: [Haskell-cafe] Music-related

2010-08-07 Thread Henning Thielemann
On Sat, 7 Aug 2010, Johann Bach wrote: Midi files or music exported by the typical music editor is expressionless. A *human* would play that music with slight tempo variations, subtle accents... some notes would be overlapped in time slightly, some separated in time. I want a program that

Re: [Haskell-cafe] lambdacats

2010-08-06 Thread Henning Thielemann
Sean Leather schrieb: On Fri, Aug 6, 2010 at 12:12 AM, Tony Morris wrote: Hello, does anyone happen to have the lambdacats page cached? The domain (arcanux.org http://arcanux.org) and server have disappeared and the wayback machine doesn't have the images.

Re: [Haskell-cafe] Why is toRational a method of Real?

2010-08-05 Thread Henning Thielemann
On Thu, 5 Aug 2010, Ivan Lazar Miljenovic wrote: On 5 August 2010 10:15, Lennart Augustsson lenn...@augustsson.net wrote: You're right.  It's bad to have toRational in Real.  It's also bad to have Show and Eq as superclasses to Num. I understand why it's bad to have Show as a superclass,

Re: [Haskell-cafe] Why is toRational a method of Real?

2010-08-05 Thread Henning Thielemann
On Wed, 4 Aug 2010, John Meacham wrote: The numeric classes are sort of messed up when it comes to non integral values. (not that they are perfect for other things) for instance, realToFrac doesn't preserve NaN or Infinity, Why should realToFrac do this? NaN, Infinity and +/-0 are IEEE

Re: [Haskell-cafe] Why is toRational a method of Real?

2010-08-05 Thread Henning Thielemann
On Thu, 5 Aug 2010, David Virebayre wrote: On Thu, Aug 5, 2010 at 11:35 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: What else shall a rounding function return if not integers? Getting from 29.84645 to 29.85 isn't rounding ? Sure, it is, I missed that. Maybe such rounding

Re: [Haskell-cafe] Why is toRational a method of Real?

2010-08-05 Thread Henning Thielemann
On Thu, 5 Aug 2010, David Virebayre wrote: On Thu, Aug 5, 2010 at 1:11 PM, John Meacham j...@repetae.net wrote: use. This isn't to say ghc is doing the wrong thing, I don't think there really is a right thing to do here given the broken class specifications in the report. I often read that

Re: [Haskell-cafe] Why is toRational a method of Real?

2010-08-05 Thread Henning Thielemann
On Thu, 5 Aug 2010, David Virebayre wrote: It's sad because the class alias proposal was dropped from Haskell' two years ago, isn't it ? I don't know, but I think before an extension can go into Haskell' it should be at least implemented somewhere. (Is it implemented in JHC at all?)

Re: [Haskell-cafe] Maybe to Either -- is there a better way?

2010-08-04 Thread Henning Thielemann
Ivan Lazar Miljenovic schrieb: Yitzchak Gale g...@sefer.org writes: While useful, I think its ubiquity to simplicity ratio is not high enough to justify either depending on MissingH just for that, or adding it to a base library. Just like the swap :: (a,b) - (b,a) function a lot of people

Re: [Haskell-cafe] real-time audio processing

2010-08-04 Thread Henning Thielemann
On Wed, 4 Aug 2010, Stephen Sinclair wrote: On Aug 3, 8:31 pm, Jeremy Shaw jer...@n-heptane.com wrote:  The only area I have had any trouble with Haskell is doing realtime music synthesis. And only because the garbage collector is not realtime friendly. That is not unfixable though. However,

Re: [Haskell-cafe] real-time audio processing [Was: can Haskell doeryting as we want?]

2010-08-04 Thread Henning Thielemann
On Wed, 4 Aug 2010, Don Stewart wrote: job.vranish: Hmm, it looks like the HASP project is working on some of this, though I'm not sure how portable their work is back to GHC: http://hasp.cs.pdx.edu/ Or look at EDSLs, like Atom: http://hackage.haskell.org/package/atom Maybe

Re: [Haskell-cafe] Re: Microsoft's Singularity Project and Haskell

2010-08-02 Thread Henning Thielemann
David Leimbach schrieb: Haskell's great and all but it does have a few warts when it comes to how much real trust one should put into the type system. Some compromises still exist like unsafePerformIO that you can't detect simply by looking at the types of functions. In order to live up

Re: [Haskell-cafe] dear traversable

2010-07-31 Thread Henning Thielemann
On Fri, 30 Jul 2010, Ben wrote: dear traversable geniuses -- i am looking for better implementations of unzipMap :: M.Map a (b, c) - (M.Map a b, M.Map a c) unzipMap m = (M.map fst m, M.map snd m) Maybe: mapPair (M.fromAscList, M.fromAscList) $ unzip $ map (\(a,(b,c)) - ((a,b),

Re: [Haskell-cafe] Announce type-level-natural-number-1.0: Simple, Haskell 2010-compatible type level natural numbers

2010-07-31 Thread Henning Thielemann
On Fri, 30 Jul 2010, John Meacham wrote: Heh. I was just thinking I needed type level naturals last night at the pub. I thought about type level naturals yesterday when working with HList and found that HList's dependency on TemplateHaskell is quite heavy. I wanted to support gcc's

Re: [Haskell-cafe] Laziness question

2010-07-31 Thread Henning Thielemann
michael rice schrieb: So, g is stricter than f? Wouldn't both functions need to evaluate x to the same level, *thunk* : *thunk* to insure listhood? No. :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] OpenGL Speed!

2010-07-30 Thread Henning Thielemann
Vo Minh Thu schrieb: There other possibilities to deal with raster graphics: - Use gtk; i.e. something like http://hackage.haskell.org/package/AC-EasyRaster-GTK - Output the data in some image format (if you want to do it yourself, the most simple is PPM) - Use X11 directly (if you're on

Re: [Haskell-cafe] OpenGL Speed!

2010-07-30 Thread Henning Thielemann
On Fri, 30 Jul 2010, Eitan Goldshtrom wrote: HGL actually looks like EXACTLY what I need. I only need to set pixels, which looks like just what HGL would be good at. Only problem is that I can't find a single tutorial for HGL. Does anyone know or any, or where I could find one? I found the

Re: [Haskell-cafe] monoids and monads

2010-07-27 Thread Henning Thielemann
John Lato schrieb: Hello, I was wondering today, is this generally true? instance (Monad m, Monoid a) = Monoid (m a) where mempty = return mempty mappend = liftM2 mappend I know it isn't a good idea to use this instance, but assuming that the instance head does what I mean, is it

Re: [Haskell-cafe] monoids and monads

2010-07-27 Thread Henning Thielemann
John Lato schrieb: Hello, I was wondering today, is this generally true? instance (Monad m, Monoid a) = Monoid (m a) where mempty = return mempty mappend = liftM2 mappend I know it isn't a good idea to use this instance, but assuming that the instance head does what I mean, is it

Re: [Haskell-cafe] fine control of bytestring streaming

2010-07-27 Thread Henning Thielemann
On Tue, 27 Jul 2010, Alberto G. Corona wrote: The question is: are there some way to control bytestring streaming?. Can It be done without the stream handler? I think there is a function that converts a lazy ByteString to a list of strict ByteStrings, that should work without copying the

Re: [Haskell-cafe] Instances for Set of Functor, Traversable?

2010-07-26 Thread Henning Thielemann
On Mon, 26 Jul 2010, Gregory Crosswhite wrote: Is there a specific reason why Set doesn't have instances for Functor and Traversable? Sure, fmap needs an Ord restriction for the element type, which is not possible for the plain Functor constructor class. E.g. in fmap (const 'a') set

Re: [Haskell-cafe] Porting ELF statifier to Haskell!

2010-07-24 Thread Henning Thielemann
C K Kashyap schrieb: Hi, At my work we ran into a situation where we started wishing there was a way to take a dynamically linked executable and create a statically linked bundle out of it. Little bit of googling got me to statifier - http://statifier.sourceforge.net/statifier/main.html. I

Re: [Haskell-cafe] bounded ranges

2010-07-22 Thread Henning Thielemann
On Thu, 22 Jul 2010, Chad Scherrer wrote: Hello cafe, I'm trying to do some things with bounded indices so I can carry around arrays (well, Vectors, really) without needing to refer to the bounds. For example, if I know my indices are Bool values, I can do rangeSize (minBound, maxBound ::

Re: [Haskell-cafe] Plotting Vectors with GnuPlot Wrapper

2010-07-17 Thread Henning Thielemann
Maryam Moghadas schrieb: Hi When I use Vectors as a PlotStyle in Graphics.Gnuplot.Simple, the output curve.gp http://curve.gp and curve0.csv is not generated correctly. For example when I write in ghci: plotPathStyle [] (PlotStyle Vectors (DefaultStyle 1)) [(1,1),(2,7)] Yes, my wrapper

Re: [Haskell-cafe] ByteString, zipWith', and rewrite rules

2010-07-13 Thread Henning Thielemann
Thomas M. DuBuisson wrote: Comments on the zipWith' function inside of Data.ByteString say: -- Rewrite rules -- are used to automatically covert zipWith into zipWith' when a pack is -- performed on the result of zipWith. This is only true internally to Data.ByteString because the zipWith'

Re: [Haskell-cafe] Transformers versus monadLib versus...

2010-07-10 Thread Henning Thielemann
On Mon, 5 Jul 2010, Gregory Crosswhite wrote: Hey everyone, What is the current state regarding transformers versus monadLib versus mmtl versus ... etc.? Transformers seems to be the blessed replacement for mtl, so when is it worthwhile to use the other libraries instead? I like

Re: [Haskell] Re: [Haskell-cafe] ANN: HaRe-0.6, now on Hackage

2010-07-10 Thread Henning Thielemann
Chris BROWN schrieb: Daniel, Ivan, One comment on your .cabal file: it's usually preferred to write base = 3 5 rather than base = 3 = 4. In particular if e.g. base-4.2.0.0 doesn't fall in the latter range. I don't know how exactly Cabal interprets these bounds, but it's a possibility

Re: [Haskell-cafe] What is Haskell unsuitable for?

2010-07-08 Thread Henning Thielemann
On Tue, 6 Jul 2010, Edward Kmett wrote: While we're on the topic, does anyone else get funny looks when they say monads? Sadly, yes. ;) There is no need anymore to bother people with the word monad: http://www.haskell.org.monadtransformer.parallelnetz.de/haskellwiki/Category:Monad

Re: [Haskell-cafe] reading and playing music openAL

2010-07-07 Thread Henning Thielemann
On Tue, 6 Jul 2010, Maria Gabriela Valdes wrote: Hi ! We have a question about about openAL. We would like to know if anybody knows how to read a WAV file by chunks of a determined size, and after doing some processing with a specific chunk send that same chunk back to the sound card so we

Re: [Haskell-cafe] ANNOUNCE: ghc-gc-tune: a tool for analyzing the impact of GC flags

2010-07-06 Thread Henning Thielemann
Andrew Coppin schrieb: I've always thought of compiler flags as being a fairly imprecise tool. For example, -funbox-strict-fields applies a particular transformation to EVERY STRICT FIELD IN THE ENTIRE PROGRAM. Which is fine if it's always a win - but then, if it were always a win, there

Re: [Haskell-cafe] music-related problem

2010-07-04 Thread Henning Thielemann
On Sun, 4 Jul 2010, Michael Mossey wrote: I can solve a simpler problem which is -- Given a note with tieNext set, and a list of notes, find -- the end Loc of the last note in the chain. Only notes -- with the same pitch as 'firstNote' are considered when looking -- for the chain of notes.

Re: [Haskell-cafe] music-related problem

2010-07-04 Thread Henning Thielemann
On Sun, 4 Jul 2010, Michael Mossey wrote: Serguey Zefirov wrote: The thing that is hard for me to understand is how, in a functional paradigm, to update the entire Doc by chasing down every tie and making all necessary updates. This looks like one of graph algorithms. Notes are nodes, ties

Re: [Haskell-cafe] music-related problem

2010-07-04 Thread Henning Thielemann
On Sun, 4 Jul 2010, Stephen Tetley wrote: If you add Rest as an alternative constructor to Item you should be able to attribute Items with their duration rather than their onset position. For most processing this would simplify things. This is also the way, Haskore organizes its data, but

Re: [Haskell-cafe] Space leak with unsafePerformIO

2010-06-28 Thread Henning Thielemann
On Sun, 27 Jun 2010, Henning Thielemann wrote: Maybe I can combine splitAtLazy and (++) to a function like splitAtAndAppend :: [x] - ([a] - [b]) - ([a] - [b]) - [a] - [b] but I'm afraid I will need pairs temporarily and then I run into the same problems. I have now implemented a solution

Re: [Haskell-cafe] Space leak with unsafePerformIO

2010-06-27 Thread Henning Thielemann
On Sun, 27 Jun 2010, Bertram Felgenhauer wrote: If the compiler had produced Main.lvl3 = case Main.ds of wild_Xw { (prefix_aCf, suffix_aCh) - suffix_aCh } Main.lvl4 = Main.go1 Main.lvl3 instead, then there would not be a leak. This whole record selector thunk business is very

[Haskell-cafe] Space leak with unsafePerformIO

2010-06-26 Thread Henning Thielemann
Attached is a program with a space leak that I do not understand. I have coded a simple 'map' function, once using unsafePerformIO and once without. UnsafePerformIO has a space leak in some circumstances. In the main program I demonstrate cases with and without space leak. Without space leak the

Re: [Haskell-cafe] Re: ANN: bitspeak 0.0.1

2010-06-24 Thread Henning Thielemann
On Mon, 21 Jun 2010, Maurí­cio CA wrote: bitspeak is a small proof of concept application that allows writing text using only two commands (yes/no, 1/2, top/down etc.). Looks cool! Did you forget any dependencies tho? I get the following error: Oops... Three modules ended up missing in

Re: [Haskell-cafe] Re: What is Haskell unsuitable for?

2010-06-18 Thread Henning Thielemann
Maciej Piechotka schrieb: 1. Glueing a few highier level, object-oriented libraries if it is just glueing. 2. (Currently) AFAIK real-time applications although it is rather property of GHC GC then the language itself In my experience the garbage collector was not the problem in real-time

Re: [Haskell-cafe] What is Haskell unsuitable for?

2010-06-17 Thread Henning Thielemann
On Wed, 16 Jun 2010, Marc Weber wrote: Hi Aditya Siram, - maybe shell scripting: running ghci takes longer than starting bash. Compiling is not always an option because executables are bigger than shell scripts or C executables Is Hugs better in this respect?

Re: [Haskell] ANNOUNCE: Sifflet visual programming language, release 0.1.7

2010-06-11 Thread Henning Thielemann
gdwe...@iue.edu schrieb: Sifflet 0.1.7 is now available on Hackage. This release has some changes in its package dependencies, notably for fgl. New in This Release --- - Due to anticipated changes in the API for fgl, Sifflet now requires fgl 5.4.2.3. -

[Haskell-cafe] Re: package naming policy

2010-06-11 Thread Henning Thielemann
On Tue, 8 Jun 2010, Don Stewart wrote: Great points: I've added them to this wiki page of for and against points: http://haskell.org/haskellwiki/Libraries/WhenToRewriteOrRename Please add points as you see fit, and maybe we can come up with a mitigation/change plan. Closely related is

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Sifflet visual programming language, release 0.1.7

2010-06-11 Thread Henning Thielemann
On Fri, 11 Jun 2010, Ben Millwood wrote: On Fri, Jun 11, 2010 at 2:52 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: I'm uncertain whether fgl conforms to the package versioning policy, but if it does, then changes in its Cabal file should not bother sifflet. Thus upper bound

Re: [Haskell-cafe] Re: Difference between div and /

2010-06-03 Thread Henning Thielemann
Richard O'Keefe schrieb: On Jun 3, 2010, at 1:13 AM, Maciej Piechotka wrote: On Wed, 2010-06-02 at 14:01 +1200, Richard O'Keefe wrote: For what applications is it useful to use the same symbol for operations obeying (or in the case of floating point operations, *approximating* operations

Re: [Haskell-cafe] Re: Re: Difference between div and /

2010-06-03 Thread Henning Thielemann
On Thu, 3 Jun 2010, Maciej Piechotka wrote: Hmm. Thanks - however I fail to figure out how to do something like: generate a random number with normal distribution with average avg and standard deviation stdev. Unfortunately the package is restricted to discrete distributions so far.

Re: [Haskell-cafe] Re: Difference between div and /

2010-06-02 Thread Henning Thielemann
On Wed, 2 Jun 2010, Maciej Piechotka wrote: On Wed, 2010-06-02 at 14:01 +1200, Richard O'Keefe wrote: For what applications is it useful to use the same symbol for operations obeying (or in the case of floating point operations, *approximating* operations obeying) distinct laws? If the

Re: [Haskell-cafe] Re: Difference between div and /

2010-06-02 Thread Henning Thielemann
Sorry, I missed this post. Maciej Piechotka schrieb: Well - i tried to write some package dealing with distributions etc. If you have something like that: instance ... = Distribution (Linear a) a where rand (Linear f s) g = let (gf, gt) = genRange g (v, g') =

[Haskell-cafe] Re: The state of Hackage: what are we doing about it?

2010-06-01 Thread Henning Thielemann
Marc Weber schrieb: Excerpts from Don Stewart's message of Tue Jun 01 01:13:20 +0200 2010: I see fairly regular complaints about too many Haskell libraries, bewildering choice of difficult-to-determine quality. I want to send a small reminder that there was the idea adding a public wiki for

Re: [Haskell-cafe] PDF generation?

2010-06-01 Thread Henning Thielemann
On Tue, 1 Jun 2010, Jim Tittsler wrote: What is the easiest way to create PDF files from Haskell? Is gtk2hs's PDF output the preferred way? I have successfully used HPDF for http://hackage.haskell.org/package/internetmarke Certainly there could be some improvements to HPDF's API

Re: [Haskell-cafe] Wire GUI

2010-05-30 Thread Henning Thielemann
Andrew Coppin schrieb: I'm looking at a project which involves a GUI where you can insert components and wire up connections between them. Obviously the details of what the components are and what code gets executed for them is domain-specific, however the general idea of graphically wiring

Re: [Haskell-cafe] Declaring a tuple of instances of Enums as an instance of the Enum class

2010-05-25 Thread Henning Thielemann
Daniel Fischer schrieb: On Sunday 23 May 2010 15:33:58, Ivan Lazar Miljenovic wrote: R J rj248...@hotmail.com writes: Say I've got a type Month declared as an instance of the Enum class, and a type MonthPair declared as a pair of months: data Month = January | February | March | April | May |

Re: [Haskell-cafe] MultiParamClasses question

2010-05-25 Thread Henning Thielemann
On Tue, 25 May 2010, Eugeny N Dzhurinsky wrote: I'm trying to create set of polymorphic functions for working with custom containers. I decided to try out typeclass and define generic function, which uses the methods from the typeclass. The quick and naive solution is listed below: There are

<    1   2   3   4   5   6   7   8   9   10   >