Re: [Haskell-cafe] Real-time garbage collection for Haskell

2010-03-05 Thread Henning Thielemann
Curt Sampson schrieb: Understanding the general techniques for this sort of thing and seeing where you're likely to need to apply them isn't all that difficult, once you understand the problem. (It's probably much easier if you don't have to work it out all for yourself, as I did. Someone needs t

Re: [Haskell-cafe] Re: How do you rewrite your code?

2010-03-05 Thread Henning Thielemann
Ertugrul Soeylemez schrieb: As a side note: I have found that many people don't understand the filterM-based solution. That's because many people don't understand the list monad and the power of the monadic interface. So if you work in a group, either don't write code like this or preferably ex

Re: [Haskell-cafe] How do you rewrite your code?

2010-03-03 Thread Henning Thielemann
Stephen Tetley schrieb: On 2 March 2010 19:20, Sean Leather wrote: My question is simple: How do you rewrite your code to improve it? Hi Sean - excellent question! Some things I do... Quite often I do a 'worker-wrapper-lite' rewrite i.e. change a function to perform its recur

Re: [Haskell-cafe] Real-time garbage collection for Haskell

2010-03-03 Thread Henning Thielemann
Jeremy Shaw schrieb: My feeling right now is that the 'best' solution might be something similar to synthesis OS. I would create a DSL for the realtime DSP code. Using harpy, this DSL would be compiled to assembly with execution time guarantees (as much as can be predicted on modern hardware).

Re: [Haskell-cafe] Real-time garbage collection for Haskell

2010-03-01 Thread Henning Thielemann
On Sat, 27 Feb 2010, Luke Palmer wrote: I have seen some proposals around here for SoC projects and other things to try to improve the latency of GHC's garbage collector. I'm currently developing a game in Haskell, and even 100ms pauses are unacceptable for a real-time game. I'm calling out t

Re: [Haskell-cafe] Cabal pre-compiled packages

2010-03-01 Thread Henning Thielemann
On Sat, 27 Feb 2010, Diego Souza wrote: Hi, currently when one install a cabal package it compiles it and then install generated binaries. I wonder whether or not it would be useful to have pre-compiled binaries as many package managers usually do (e.g. apt). I often think that would save some

Re: [Haskell-cafe] What are "free" Monads?

2010-03-01 Thread Henning Thielemann
On Sat, 27 Feb 2010, Dan Doel wrote: Free structures originate (I think) in algebra. There you'll find talk of free groups, free rings, free monoids, etc. How about turning this post into a HaskellWiki article in Category:Glossary ? ___ Haskell-Ca

Re: [Haskell-cafe] Linear programming in Haskell

2010-03-01 Thread Henning Thielemann
On Sun, 28 Feb 2010, Louis Wasserman wrote: It's an expensive operation, though -- since I don't track the set of all variables as the LP is built, I need to construct the set of all variables before generating new ones -- so it's recommended that you get all the variables you need in one or tw

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-28 Thread Henning Thielemann
Louis Wasserman schrieb: Yo, Man, I'd never used FFI before, but it's really not as scary as I'd feared. I've implemented a more comprehensive interface to GLPK's simplex solver and -- rather importantly, for my own needs -- its MIP solver. This doesn't depend on hmatrix, and in fact, it d

Re: [Haskell-cafe] Testing and module export lists

2010-02-25 Thread Henning Thielemann
Magnus Therning schrieb: On Wed, Feb 24, 2010 at 10:41, Arnaud Bailly wrote: Maybe you just want to test what's in your export list which represents the public interface of your code. And if you cannot write a test that exercise private implementation through the public interface, then maybe

Re: [Haskell-cafe] Re: Some great results on fused code with the LLVM backend

2010-02-25 Thread Henning Thielemann
Felipe Lessa schrieb: > On Wed, Feb 24, 2010 at 01:28:56PM -0500, Edward Kmett wrote: >>> * GHC/LLVM bytecode with JIT-option? >> There is little preventing this one. > > Oh, what a great idea! C code being inlined into Haskell > functions! :D How about LLVM inline assembly code? You can already

Re: [Haskell-cafe] A small oversight

2010-02-22 Thread Henning Thielemann
On Sun, 21 Feb 2010, Leon Smith wrote: On Sat, Feb 20, 2010 at 5:47 AM, Andrew Coppin wrote:  sortOn :: (Ord y) => (x -> y) -> [x] -> [x]  sortOn foo = sortBy (compare `on` foo) Incidentally, this function is provided as Data.List.Ordered.sortOn' in the data-ordlist package... Or Key.s

Re: [Haskell-cafe] Pointfree composition for higher arity

2010-02-22 Thread Henning Thielemann
On Wed, 17 Feb 2010, Neil Brown wrote: I very often write this too (wanting function composition, but with a two-argument function on the right hand side). The trick I picked up from somewhere is to do: fun = (runFun .) . someFun someDefault I'm not too keen on that, as it seems clumsy. I

Re: [Haskell-cafe] Undecidable instances with functional dependencies

2010-02-15 Thread Henning Thielemann
Miguel Mitrofanov schrieb: -- {-# LANGUAGE FunctionalDependencies#-} -- {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} module Register where -- class Register a r | a -> r class Register a where type R a -- instance Register Int Int instance Register Int where type R

[Haskell-cafe] Undecidable instances with functional dependencies

2010-02-11 Thread Henning Thielemann
I have the following class and instance class Register a r | a -> r where instance (Register a ra, Register b rb) => Register (a,b) (ra,rb) where and GHC refuses the instance because of violated Coverage Condition. I have more instances like instance Register Int8 (Reg Int8) wher

Re: [Haskell-cafe] Re: How many "Haskell Engineer I/II/III"s are there?

2010-02-11 Thread Henning Thielemann
John Van Enk schrieb: > I need to be able to swap out the RTS. The place I want to stick Haskell > absolutely needs its own custom RTS, and currently, I don't think it's > all that easy or clean to do that. > > Am I wrong? Are there resources describing how to do this already? As far as I know JH

Re: [Haskell-cafe] vector to uvector and back again

2010-02-11 Thread Henning Thielemann
stefan kersten schrieb: >> uvector is pretty bit-rotted in comparison to vector at this point, and >> it's really seeing no development, while vector is The Shiny Future. >> Roman, would you call the vector library good enough to use in >> production at the moment? > > i've been using the library

Re: [Haskell-cafe] Links to darcs.haskel.org in the haskellwiki

2010-02-08 Thread Henning Thielemann
Ketil Malde schrieb: "Henk-Jan van Tuyl" writes: There are a lot of links in the haskellwiki that point to projects at darcs.haskel.org; I hope that anyone who moves a project, looks the links up and updates them. An example of a page with several obsolete links is I check my own pa

Re: [Haskell-cafe] foldl in terms of foldr

2010-01-26 Thread Henning Thielemann
On Tue, 26 Jan 2010, Xingzhi Pan wrote: Hi, I am reading Real World Haskell and have some questions about the piece of code implementing foldl in terms of foldr: -- file: ch04/Fold.hs myFoldl :: (a -> b -> a) -> a -> [b] -> a myFoldl f z xs = foldr step id xs z where step x g a = g (f a x)

Re: [Haskell-cafe] Lambda's

2010-01-20 Thread Henning Thielemann
On Thu, 31 Dec 2009, Henk-Jan van Tuyl wrote: I love lambda's: http://hawtness.com/2009/12/30/wtf-girl-photo-more-reasons-why-half-life-is-awesome/ cute ... I'm not sharing the collective rejection. A remark would be ok. Although I looked up the meaning of NSFW only after following your link

Re: [Haskell-cafe] ANNOUNCE: Functional Programming Bibliography

2010-01-19 Thread Henning Thielemann
James Russell schrieb: > > Not much to it, really. It's a LAMH thing, if you will. > > The Haskell part just runs as a CGI app, > and uses the HDBC, HDBC-mysql, cgi, and xhtml > packages, and is just a few hundred lines, including all > the html templates which I create with the xhtml package.

Re: [Haskell-cafe] Poor man's generic programming

2010-01-18 Thread Henning Thielemann
Neil Mitchell schrieb: Hi Henning, Uniplate might be the answer you are looking for - http://community.haskell.org/~ndm/uniplate Thanks for the pointer! Uniplate is simple (only multi parameter type classes, and even then only in a very simple usage), fast (one of the fastest generics libra

Re: [Haskell-cafe] Language simplicity

2010-01-16 Thread Henning Thielemann
Eduard Sergeev schrieb: Andrew Coppin wrote: OK people, it's random statistics time! OK, my version of meaningless statistics: C++ (ISO/IEC 14882:1998(E)): 325 pages (712 including standard libraries) C# (ECMA-334): 505 pages (language only) Java: 450 pages (language only?) Scala (2.7

Re: [Haskell-cafe] Language simplicity

2010-01-16 Thread Henning Thielemann
Niklas Broberg schrieb: Haskell '98 apparently features 25 reserved words. (Not counting "forall" and "mdo" and so on, which AFAIK are not in Haskell '98.) 21 actually. case, class, data, default, deriving, do, else, if, import, in, infix, infixl, infixr, instance, let, module, newtype, of

Re: [Haskell-cafe] Language simplicity

2010-01-16 Thread Henning Thielemann
Andrew Coppin schrieb: Hmm, I wonder if there's some way to compare the size of the language specification documents? :-} PS. It comes as absolutely no surprise to me that C++ has the most keywords. But then, if I were to add AMOS Professional, that had well over 800 keywords at the last coun

[Haskell-cafe] Poor man's generic programming

2010-01-16 Thread Henning Thielemann
Is any of the existing Generics packages able to work without compiler extensions, that is Haskell 98? I mean, it is ok if the developer of the generic parts of a library needs compiler extensions or extra tools, but the user who calls 'cabal install' shall not need them and the developer, who d

Re: [Haskell-cafe] Re: Data.Ring -- Pre-announce

2010-01-16 Thread Henning Thielemann
wren ng thornton schrieb: Tom Tobin wrote: - Heinrich Apfelmus wrote: Since the name Ring is already taken by an ubiquitous mathematical structure, and thus already in hackage for example as Algebra.Ring in the numeric-prelude , I suggest to call the data structure Necklace instead.

[Haskell-cafe] addFinalizer to which object?

2010-01-16 Thread Henning Thielemann
The documentation of System.Mem.Weak.addFinalizer suggests to me, that this function is very fragile, because the object we track, might be optimized away. In my case this applies. I have a resource that is needed for generating chunks of a lazy byte string. If the byte string is created complet

Re: [Haskell-cafe] Capped lists and |append|

2010-01-15 Thread Henning Thielemann
John Millikin schrieb: Earlier today I uploaded the capped-list package; I didn't think there would be any interest, since it's a relatively trivial data structure, but already there's been three emails and an IRC convo about it. In short, this is Heinrich Apfelmus's "Train" type from

[Haskell-cafe] Re: [Haskell] ANN: Streaming Component Combinators 0.4

2010-01-15 Thread Henning Thielemann
Mario Blažević schrieb: Henning Thielemann wrote: Stupid question: Is it related to Arrows? Not really. You might say it's more general than arrows, because the streaming components are not restricted to a single input and single output type. On the other hand, they are all specif

Re: [Haskell-cafe] space leaks and optimizations

2010-01-15 Thread Henning Thielemann
Ryan Ingram schrieb: > Hi Alexei, you have a ton of great points but I wanted to discuss an > issue with this one. > > It's unusual that this is what you want either; since it only reduces > the state to WHNF. For example, if your state is a string, this only > evaluates enough to know whether o

Re: [Haskell-cafe] sizeOf on a type

2010-01-14 Thread Henning Thielemann
On Fri, 25 Dec 2009, Lennart Augustsson wrote: sizeOfPtr :: Ptr a -> Int sizeOfPtr = sizeOf . (undefined :: Ptr a -> a) No need for scoped type variables. But it does assume sizeOf does not use its argument. That's even better. I'll add that to the Wiki.   http://www.haskell.org/haskellwi

Re: [Haskell-cafe] Re: looking for origin of quote on preprocessors and language design

2010-01-14 Thread Henning Thielemann
Maciej Piechotka schrieb: > > Hmm. May I ask how to do for example something depending on POSIX or > WinAPI? I am sorry but I cannot see how any of the above problems could > be solved. Sure, I choose different Hs-Source-Dirs for the different platforms. Multiple Hs-Source-Dirs are merged. Exam

Re: [Haskell-cafe] Re: looking for origin of quote on preprocessors and language design

2010-01-13 Thread Henning Thielemann
Maciej Piechotka schrieb: Not quite. While I agree that "the *frequent* need for a preprocessor shows omissions in (the design of) a language." it is not necessary the case. Preprocessor may be useful if: - there is a new beatyful feature in newer version of compiler but you still want to have

Re: [Haskell-cafe] ghc -e

2010-01-13 Thread Henning Thielemann
On Wed, 6 Jan 2010, Gwern Branwen wrote: On Wed, Jan 6, 2010 at 7:23 PM, Tony Morris wrote: ghc -e "import Control.Monad; forM [[1,2,3]] reverse" As of 6.10.2, the bug whereby the GHC API lets you use functions from anywhere just by naming them (Java-style) has not been fixed: $ ghc -e "Co

Re: [Haskell-cafe] Value classes

2010-01-06 Thread Henning Thielemann
Mads Lindstrøm schrieb: Hi A function inc5 inc5 :: Float -> Float inc5 x = x + 5 can only be a member of a type class A, if we make all functions from Float -> Float members of type class A. Thus, I assume, that _type_ class is named type class, as membership is decided by types. However,

Re: [Haskell-cafe] Re: Why does HXT use Arrows?

2009-12-25 Thread Henning Thielemann
On Fri, 25 Dec 2009, Heinrich Apfelmus wrote: Which begets the question of whether HXT actually uses a way of taking input other than as function parameter. It appears to me that it doesn't. Put differently, I suspect that all of HXT can be rewritten to mkCmt :: String -> M XmlTree m

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-23 Thread Henning Thielemann
Patai Gergely schrieb: >> It is the strength of Haskell to separate everything into >> logical steps and let laziness do things simultaneously. Stream fusion >> can eliminate interim lists, and final conversion to storable vector >> using http://hackage.haskell.org/package/storablevector-streamfus

Re: [Haskell-cafe] what happend with the docs of base-libs in 6.10.4

2009-12-22 Thread Henning Thielemann
On Tue, 22 Dec 2009, Günther Schmidt wrote: Hi, I was just trying to consult my html-documentation of ghc-6.10.4 libraries on Windows. Almost all of the Standard Monads are missing, State, Writer etc. They are (and already were) part of the mtl package. You may install 'mtl' manually (or

Re: [Haskell-cafe] sizeOf on a type

2009-12-22 Thread Henning Thielemann
On Fri, 18 Dec 2009, Gregory Crosswhite wrote: Yay, advancePtr is exactly what I needed! I totally missed that one in the docs. Also thanks to those of you who pointed me to the scoped type variables feature, since I had figured that a feature liked that had to exist but I just didn't know

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-22 Thread Henning Thielemann
Patai Gergely schrieb: >> I would do resampling (with some of the Interpolation routines) and >> mixing in two steps, that is I would prepare (lazy) storable vectors >> with the resampled sounds and mix them. > And is that straightforward considering the peculiarities of tracked > music? After all

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-18 Thread Henning Thielemann
Patai Gergely schrieb: >> I have a function for mixing sounds at different (relative) start times. >> I feel that it does not get maximum speed in GHC, but is still ready for >> realtime application. >> >> http://hackage.haskell.org/packages/archive/synthesizer-core/0.2.1/doc/html/Synthesizer

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-17 Thread Henning Thielemann
On Mon, 14 Dec 2009, Patai Gergely wrote: Hello all, I just uploaded the fruit of a little side project. Hemkay [1] is an oldschool module music [2] player that performs all the hard work in Haskell. Cool. The most complicated I tried was to import OctaMED printout to Haskore: http://darc

Re: [Haskell-cafe] Zumkeller numbers

2009-12-09 Thread Henning Thielemann
On Wed, 9 Dec 2009, Daniel Fischer wrote: Am Mittwoch 09 Dezember 2009 00:02:30 schrieb Lennart Augustsson: And if you use quotRem it's faster (unless you're running on some exotic hardware like NS32K). Yes, but Henning Thielemann was busy in the exception vs. error thread, so

Re: [Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Henning Thielemann
On Tue, 8 Dec 2009, Richard O'Keefe wrote: On Dec 8, 2009, at 12:28 PM, Henning Thielemann wrote: It is the responsibility of the programmer to choose number types that are appropriate for the application. If I address pixels on a todays screen I will have to choose at least Word16.

Re: [Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Henning Thielemann
On Tue, 8 Dec 2009, Richard O'Keefe wrote: X/0, sqrt(-1), head [] are errors It depends on WHERE THE DATA CAME FROM. If your program actually computes X/0 or sqrt(-1) or head [] your program is buggy, independent from where the zero, the minus one or the empty list comes. Sure, the dist

Re: [Haskell-cafe] Zumkeller numbers

2009-12-07 Thread Henning Thielemann
On Tue, 8 Dec 2009, Richard O'Keefe wrote: is_Zumkeller :: Int -> Bool is_Zumkeller n = let facs = factors n fsum = sum facs in mod fsum 2 == 0 && I see this test is essential. I didn't do it and thus my program did not find that 1800 is not a Zumkeller number within an hour. With

Re: [Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Henning Thielemann
On Tue, 8 Dec 2009, Ben Franksen wrote: Michael, Henning There are two meanings to the word 'exception' in this context; both of you tend to conflate these different meanings. One meaning is about a *mechanism* for non-local control flow; the other is about certain classes of un-desired progra

Re: [Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Henning Thielemann
On Tue, 8 Dec 2009, Richard O'Keefe wrote: When I was working at Quintus, I came up with a classification which I can simplify something like this: It's certainly possible to classify errors and exceptions in other (also more fine grained) ways ... operating system fault Somethin

Re: [Haskell-cafe] Zumkeller numbers

2009-12-07 Thread Henning Thielemann
On Mon, 7 Dec 2009, Frank Buss wrote: Anyone interested in writing some lines of Haskell code for generating the Zumkeller numbers? http://www.luschny.de/math/seq/ZumkellerNumbers.html My C/C# solutions looks clumsy (but is fast). I think this can be done much more elegant in Haskell with l

[Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Henning Thielemann
On Mon, 7 Dec 2009, Michael Snoyman wrote: I actually *did* read your article, and don't know what you are referring to. If this is true, sorry, I didn't had the impression. I also think that in an earlier mail I answered, that errors can leave you with corrupt data, say invalid file handle

[Haskell-cafe] Re: Are there standard idioms for lazy, pure error handling?

2009-12-07 Thread Henning Thielemann
@Apfelmus: For practical purposes I think Train should have swapped type parameters in order to make Functor act on the type of the list elements. data Train b a = Wagon a (Train b a) | Loco b ___ Haskell-Cafe mailing list Haskell-C

[Haskell-cafe] Re: Are there standard idioms for lazy, pure error handling?

2009-12-07 Thread Henning Thielemann
Somehow I missed this thread. I want to say that I have implemented a general way to add the information of an exception to the "end" of an arbitrary data structure. http://hackage.haskell.org/packages/archive/explicit-exception/0.1.4/doc/html/Control-Monad-Exception-Asynchronous.html Dunca

[Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Henning Thielemann
I turn it around: give me an example where it's better for the runtime to exit than for some type of exception to be thrown, and *I'll* think about it ;). If you would have read my article, you had one ... ___ Haskell-Cafe mailing list Haskell-Cafe@

[Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Henning Thielemann
On Mon, 7 Dec 2009, Michael Snoyman wrote: The only opinion I've stated so far is that it's ridiculous to constantly demand that people follow your definition of error vs exception, since the line is incredibly blurry and it buys you very little. If you have an example that is not contained

Re: [Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Henning Thielemann
Michael Snoyman schrieb: > > > On Mon, Dec 7, 2009 at 5:30 AM, Ben Franksen > wrote: > > Michael Snoyman wrote: > > > On the other hand, what's so bad about treating errors as exceptions? If > > instead of the program crashing on an array-out-of-bound

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: control-monad-exception 0.5 with monadic call traces

2009-12-07 Thread Henning Thielemann
Gregory Crosswhite schrieb: > Ah, I had been meaning to read your article, so I appreciate you posting the > link to it a second time. :-) > > Out of curiosity, how would you classify an "error" that results from a > perfectly fine program, but ill-formed user input, such as when compiling a >

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: control-monad-exception 0.5 with monadic call traces

2009-12-07 Thread Henning Thielemann
klondike schrieb: > Now comes the time when I have to show you that not every exception > could be handled, IE a file not found exception when looking for the > config file can be fatal and force the program to stop. But what if this > is on a library? How do you suggest that the programmer knows

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: control-monad-exception 0.5 with monadic call traces

2009-12-07 Thread Henning Thielemann
klondike schrieb: > Henning Thielemann escribió: > >> It seems again to me, that mixing of (programming) errors and >> exceptions is going on, and I assumed that the purpose of >> control-monad-exception is to separate them in a better way. > You know, could you tell me

Re: [Haskell-cafe] Insert a laziness break into strict ST

2009-12-07 Thread Henning Thielemann
On Sun, 6 Dec 2009, Antoine Latter wrote: On Sun, Dec 6, 2009 at 5:46 PM, Henning Thielemann I hoped to get the first answer also for the second command. It seems that conversion from lazy to strict ST also removes laziness breaks. It seems that I have to stick to unsafeInterleaveIO, but I

[Haskell-cafe] Insert a laziness break into strict ST

2009-12-06 Thread Henning Thielemann
I have lot of ST actions that shall be bound strictly (they write to a buffer), but somewhere between these actions I like to have a "laziness break". I thought I could do this by temporarily switching to Lazy.ST, but this does not work. It follows a simplified example Prelude> :module Control.Mon

Re: [Haskell-cafe] New Hackage category: Error Handling

2009-12-05 Thread Henning Thielemann
On Sat, 5 Dec 2009, Henning Thielemann wrote: On Sun, 6 Dec 2009, Michael Snoyman wrote: I think there are plenty of examples like web servers. A text editor with plugins? I don't want to lose three hours worth of work just because some plugin wasn't written correctly. For many

Re: [Haskell-cafe] New Hackage category: Error Handling

2009-12-05 Thread Henning Thielemann
On Sun, 6 Dec 2009, Michael Snoyman wrote: I think there are plenty of examples like web servers. A text editor with plugins? I don't want to lose three hours worth of work just because some plugin wasn't written correctly. For many classes of programs, the distinction between error and exce

Re: [Haskell-cafe] New Hackage category: Error Handling

2009-12-05 Thread Henning Thielemann
On Sat, 5 Dec 2009, Michael Snoyman wrote: On Sat, Dec 5, 2009 at 7:41 PM, Ross Paterson wrote: On Sat, Dec 05, 2009 at 05:52:11PM +0200, Michael Snoyman wrote: > For the record, I find this pedanticism misplaced, ... I think you'll find that's "pedantry". Hoped someone wo

Re: [Haskell-cafe] Low Level Audio - Writing bytes to the sound card?

2009-12-04 Thread Henning Thielemann
M Xyz schrieb: > > Did you look at synthesizer ? There is a short introductory file [1]. > Cheers, > Thu > > [1] > > http://hackage.haskell.org/packages/archive/synthesizer-core/0.2.1/doc/html/Synthesizer-Plain-Tutorial.html > > Thanks for the tutorial link. As I'm new to Ha

Re: [Haskell-cafe] New Hackage category: Error Handling

2009-12-04 Thread Henning Thielemann
Gregory Crosswhite schrieb: > When I uploaded my new package, "error-message", I also went ahead and > created a new category: "Error Handling". "Error handling" is the same as "debugging" for you? I hope it is not intended for generating further confusion about "exception handling" and "debugg

Re: [Haskell-cafe] ANNOUNCE: error-message

2009-12-04 Thread Henning Thielemann
Gregory Crosswhite schrieb: > If there is one thing that we really don't have enough of in Haskell, it is > *ways to handle errors*! Thus, I am pleased to announce the release of the > "error-message" package to help in filling this, erm, gap. > > This philosophy behind this package is that it

Re: [Haskell-cafe] GHC magic optimization ?

2009-12-03 Thread Henning Thielemann
On Thu, 3 Dec 2009, Emmanuel CHANTREAU wrote: Hello One thing is magic for me: how GHC can know what function results to remember and what results can be forgotten ? Is it just a stupid buffer algorithm or is there some mathematics truths behind this ? Although it is not required by the Has

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-03 Thread Henning Thielemann
On Wed, 2 Dec 2009, Stephen Tetley wrote: As for the second half of what you get from a programming language, your system description frames what you want to do with an emphasis on dynamic aspects. This seems a good way off from the prior art in Haskell. For instance there are Haskell synthesiz

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-03 Thread Henning Thielemann
Michael P Mossey schrieb: > Perhaps someone could either (1) help me do what I'm trying to do, or > (2) show me a better way. > > I have a problem that is very state-ful and I keep thinking of it as OO, > which is driving me crazy. Haskell is several times harder to use than > Python in this insta

[Haskell-cafe] Re: [Haskell] ANN: NoSlow - Microbenchmarks for array libraries

2009-12-01 Thread Henning Thielemann
On Fri, 27 Nov 2009, Henning Thielemann wrote: On Fri, 27 Nov 2009, Roman Leshchinskiy wrote: You can get more information (including the ugly tables) from my blog http://unlines.wordpress.com/2009/11/27/noslow Btw. storablevector supports 'zip' using http://hackage.haskell.o

Re: [Haskell-cafe] Re: [Haskell] ANN: NoSlow - Microbenchmarks for array libraries

2009-11-28 Thread Henning Thielemann
Duncan Coutts schrieb: > On Sat, 2009-11-28 at 09:29 -0800, Bryan O'Sullivan wrote: >> On Fri, Nov 27, 2009 at 1:05 PM, Henning Thielemann >> wrote: >> >> I found that the dependency on Cairo and GTK originates from >> criterion. I have

[Haskell-cafe] Re: [Haskell] ANN: NoSlow - Microbenchmarks for array libraries

2009-11-27 Thread Henning Thielemann
On Fri, 27 Nov 2009, Roman Leshchinskiy wrote: You can get more information (including the ugly tables) from my blog http://unlines.wordpress.com/2009/11/27/noslow Btw. storablevector supports 'zip' using http://hackage.haskell.org/package/storable-tuple but you may also use 'zipWith' wi

[Haskell-cafe] Re: [Haskell] ANN: NoSlow - Microbenchmarks for array libraries

2009-11-27 Thread Henning Thielemann
On Fri, 27 Nov 2009, Roman Leshchinskiy wrote: It compiles and runs (using Brian's criterion) a fairly random collection of very small loop kernels for each of those and produces a lot of data which it then uses to generate ugly HTML tables. In the future, it will have more benchmarks, more

[Haskell-cafe] Re: [Haskell] ANN: NoSlow - Microbenchmarks for array libraries

2009-11-27 Thread Henning Thielemann
Roman Leshchinskiy schrieb: > I'm pleased to announce NoSlow, a nascent benchmark suite for various array > (and list) libraries with particular emphasis on finding out how well they > fuse things. At the moment, it knows about > > * standard lists > * primitive DPH arrays (dph-prim-seq) >

[Haskell-cafe] Re: [Haskell] ANN: NoSlow - Microbenchmarks for array libraries

2009-11-27 Thread Henning Thielemann
Roman Leshchinskiy schrieb: > I'm pleased to announce NoSlow, a nascent benchmark suite for various array > (and list) libraries with particular emphasis on finding out how well they > fuse things. At the moment, it knows about > > * standard lists > * primitive DPH arrays (dph-prim-seq) >

Re: [Haskell-cafe] Some help needed to start Haskell with Yi

2009-11-19 Thread Henning Thielemann
On Thu, 19 Nov 2009, Daniel Fischer wrote: A separate package for that orphan instance would be the best solution. I'm not sure that's really better. With a separate package, you'd have dependencies packageY, orphanInstance. When a new version of packageY with the instance is uploaded, thing

Re: [Haskell-cafe] Some help needed to start Haskell with Yi

2009-11-18 Thread Henning Thielemann
Daniel Fischer schrieb: > Am Donnerstag 19 November 2009 01:07:37 schrieb Henning Thielemann: > >> Seems to be that the author defined an orphan instance - something one >> should never do! > > So what do you do if you need an instance ClassX TypeY but the author of the &

Re: [Haskell-cafe] inversion lists

2009-11-18 Thread Henning Thielemann
Ted Zlatanov schrieb: > On Mon, 16 Nov 2009 00:03:54 +0300 Eugene Kirpichov > wrote: > > EK> 2009/11/15 Michael Mossey : >>> Can someone tell me if this is correct. I'm guessing that if I represent >>> two sets of integers by Word32 (where ith bit set means i is in the set), >>> then an algorit

Re: [Haskell-cafe] Some help needed to start Haskell with Yi

2009-11-18 Thread Henning Thielemann
Kapil Hari Paranjape schrieb: > Hello, > > On Sat, 14 Nov 2009, Jaco van Iterson wrote: >> Only installation with 'cabal install yi' in a Cygwin shell under MS Windows >> XP ended in: >> Yi\Prelude.hs:182:9: >> Duplicate instance declarations: >> instance Category Accessor.T -- Defined a

Re: [Haskell-cafe] unboxed arrays restricted to simple types (Int, Float, ..)

2009-11-16 Thread Henning Thielemann
On Wed, 11 Nov 2009, Tom Nielsen wrote: There's a couple of things going on here: -If you use storablevector and storable-tuple, or uvector, you can store tuples of things. So your stupidArrayElement could be mimicked by (Int, Int). Btw. there is Data.Array.Storable. Maybe I should just add

Re: [Haskell-cafe] help with musical data structures

2009-11-15 Thread Henning Thielemann
On Sat, 14 Nov 2009, Michael Mossey wrote: I'm pretty new to Haskell so I don't know what kind of data structure I should use for the following problem. Some kind of arrays, I guess. One data item, called OrientedPCSet ("oriented pitch class set," a musical term) will represent a set whose mem

Re: [Haskell-cafe] Opinion about JHC

2009-11-14 Thread Henning Thielemann
On Fri, 13 Nov 2009, John Meacham wrote: On Fri, Nov 13, 2009 at 08:55:51PM +, Lennart Augustsson wrote: That was indeed my point. Since a compiler is a substantial program I would have more confidence it a compiler that is self-hosting. Surely you must have tried? No, there are extensi

Re: [Haskell-cafe] a problem defining a monad instance

2009-11-11 Thread Henning Thielemann
On Fri, 6 Nov 2009, Petr Pudlak wrote: Hi all, (This is a literate Haskell post.) I've encountered a small problem when trying to define a specialized monad instance. Maybe someone will able to help me or to tell me that it's impossible :-). To elaborate: I wanted to define a data type whi

Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-11 Thread Henning Thielemann
Stephen Tetley schrieb: > Why speak nonsense when you can test it? > > // > > > module nonsense > > import StdEnv > > nonsense = map ((^) 2) > > Start = nonsense [1,2,3] > > // > ---

[Haskell-cafe] Re: [Haskell] ANNOUNCE: control-monad-exception 0.5 with monadic call traces

2009-11-07 Thread Henning Thielemann
On Sat, 7 Nov 2009, Jose Iborra wrote: Sorry for the confusion, I never meant that c-m-e can show stack traces for asynchronous exceptions. It can not. My post was not related in any way to asynchronous exceptions. It's just the everlasting issue of the distinction of programming errors and

Re: [Haskell-cafe] Fair diagonals

2009-11-05 Thread Henning Thielemann
On Wed, 4 Nov 2009, Sjoerd Visscher wrote: On Nov 4, 2009, at 3:21 PM, Twan van Laarhoven wrote: I looked on hackage but I was surprised that I couldn't find this simple monad. The package level-monad does look very similar, only it uses a different list type for the represe

Re: [Haskell-cafe] ANNOUNCE: feldspar-language

2009-11-05 Thread Henning Thielemann
On Wed, 4 Nov 2009, Emil Axelsson wrote: I'm happy to announce the first release of Feldspar, which is an embedded domain-specific language with associated code generator mainly targeting DSP algorithms. The language is developed in cooperation by Ericsson, Chalmers University and Eötvös Lorá

Re: [Haskell-cafe] ANNOUNCE: feldspar-language

2009-11-05 Thread Henning Thielemann
On Tue, 3 Nov 2009, Warren Henning wrote: I see that section 4.1 of the user guide - http://feldspar.sourceforge.net/documents/language/FeldsparLanguage.html#htoc23 - includes an example involving autocorrelation. Does this mean I could use Feldspare to easily build my own Autotune program? I

[Haskell-cafe] Re: [Haskell] ANNOUNCE: control-monad-exception 0.5 with monadic call traces

2009-11-05 Thread Henning Thielemann
On Tue, 3 Nov 2009, Jose Iborra wrote: On 03/11/2009, at 14:24, Henning Thielemann wrote: Sure, this is a nice functionality. But isn't it about debugging, not exception handling? Internal Server Error means to me, the server has a bug, thus we want to know, how to reproduce it, thu

Re: [Haskell-cafe] Storable Vector as a Storable record?

2009-11-05 Thread Henning Thielemann
Hi, Is it possible to somehow make a StorableVector of a StorableVector via store-record or something? If yes, could some one please provide me with some hint?  storable-record just assists with generating Storable instances. It helps using correct aligment and correct order of entries. It d

[Haskell-cafe] Re: [Haskell] ANNOUNCE: control-monad-exception 0.5 with monadic call traces

2009-11-03 Thread Henning Thielemann
Jose Iborra schrieb: > Folks, > > I'm happy to announce a new release of control-monad-exception with > monadic call traces, > available in Hackage. Grab it now while it is still online! > > Monadic stack traces are described in detail in a blog post [1]. > > In short, what this means for your c

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Henning Thielemann
Jochem Berndsen schrieb: On Sun, Nov 01, 2009 at 07:58:00AM -0600, Thomas Hartman wrote: http://hackage.haskell.org Hackage is down currently, I am seeding the torrent by mauke from IRC on http://mauke.ath.cx/tmp/2009-10-19-hackage-archive.torrent Cool, is this the beginning of distribut

Re: [Haskell-cafe] Applicative but not Monad

2009-11-01 Thread Henning Thielemann
Yusaku Hashimoto schrieb: > Hello cafe, > Do you know any data-type which is Applicative but not Monad? Here you also find an example: http://www.haskell.org/haskellwiki/Applicative_functor ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://w

Re: [Haskell-cafe] ghci REPL output under Haskell Platform on Mac OS X

2009-11-01 Thread Henning Thielemann
Mark Lentczner schrieb: > My ghci installation has a very annoying behavior: When it takes input, > the result is displayed on the same line as the input, overwriting the > prompt and input. Viz.: > > [1015] : ghci > GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help > Loa

Re: [Haskell-cafe] Newcomers question

2009-10-31 Thread Henning Thielemann
On Sat, 31 Oct 2009, b1g3ar5 wrote: I'm trying: instance Num b => Num (a -> b) where fromInteger = pure . Prelude.fromInteger negate = fmap Prelude.negate (+) = liftA2 (Prelude.+) (*) = liftA2 (Prelude.*) abs = fmap Prelude.abs signum = fmap Prelude.signum but the compiler rejects it with: s

[Haskell-cafe] Re: [Haskell] ANN: quickcheck-poly - Automating QuickCheck for polymorphic/overloaded properties in a small world of types

2009-10-24 Thread Henning Thielemann
On Sat, 24 Oct 2009, Henning Thielemann wrote: Maybe you could write a block of quickCheck tests, that shall be run on different types. tests :: a -> IO () tests x = do quickCheck (\y -> law1 (y `asTypeOf x)) ... must be `asTypeOf` allTests = tests (undefined :: Int)

[Haskell-cafe] Re: [Haskell] ANN: quickcheck-poly - Automating QuickCheck for polymorphic/overloaded properties in a small world of types

2009-10-24 Thread Henning Thielemann
Ahn, Ki Yung schrieb: > Often times QuickCheck properties are polymophic/overloaded without > giving a monomorphic type signature. But there can be several types > that you are interested. You can write scripts that check all the types > you are interested annotating the generic property for each

Re: [Haskell-cafe] Is there a null statement that does nothing?

2009-10-24 Thread Henning Thielemann
Dan Weston schrieb: > If you have a long if/else if/else chain, you might consider a trivial > case statement with guards. Whether you think this is attractive is a > matter of taste, but it has the fall-through semantics you want and ghc > optimizes the _ pattern matching away: > > f x = case ()

Re: [Haskell-cafe] How to use "bracket" properly ?

2009-10-21 Thread Henning Thielemann
zaxis schrieb: > winSSQ count noRed noBlue = do { > yesRed <- [1..33] \\ noRed; > yesBlue <- [1..16] \\ noBlue; > bracket (openFile "ssqNum.txt" WriteMode) (hClose) (\hd1 -> pickSSQ > count yesRed yesBlue hd1); > return () You might prefer 'withFile' or even better and if possible

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