Re: [Haskell-cafe] Portability of MonadError

2009-01-05 Thread Henning Thielemann
On Mon, 5 Jan 2009, Luke Palmer wrote: Oh bother!  My new year's resolution: think before I speak. While I do think this is the right answer, it is not the right answer in the status quo.  This is because ErrorT e m is only a monad when e is an Error, which Either (and most types) are not.  

Re: [Haskell-cafe] unsafeInterleaveIO respecting order of actions

2009-01-04 Thread Henning Thielemann
On Sat, 3 Jan 2009, Henning Thielemann wrote: I think I now have general Applicative functionality ... I hope the following is a proper Monad implementation. In contrast to Applicative a Writer for sequencing actions does no longer work, instead I need a State monad. newtype LazyIO a

Re: [Haskell-cafe] unsafeInterleaveIO respecting order of actions

2009-01-03 Thread Henning Thielemann
On Sat, 3 Jan 2009, Henning Thielemann wrote: On Thu, 1 Jan 2009, Brandon S. Allbery KF8NH wrote: On 2009 Jan 1, at 16:44, Henning Thielemann wrote: If it is generally possible to use unsafeInterleaveIO such that it executes actions in the right order, wouldn't this allow the definiti

Re: [Haskell-cafe] databases in Haskell & type-safety

2009-01-03 Thread Henning Thielemann
Gour schrieb: > Hi! > > I'd like to use sqlite3 as application storage in my haskell project... > > Browsing the available database options in Haskell it seems that: > > a) HSQL is dead (hackage reports build-failure with 6.8 & 6.10) No, it is maintained by frede...@ofb.net . I have also contri

Re: [Haskell-cafe] unsafeInterleaveIO respecting order of actions

2009-01-03 Thread Henning Thielemann
On Thu, 1 Jan 2009, Brandon S. Allbery KF8NH wrote: On 2009 Jan 1, at 16:44, Henning Thielemann wrote: If it is generally possible to use unsafeInterleaveIO such that it executes actions in the right order, wouldn't this allow the definition of a general lazy IO monad? I th

Re: [Haskell-cafe] Re: How do we decide on the new logo?

2009-01-02 Thread Henning Thielemann
Achim Schneider schrieb: > Step 2: Determine the winner by polling preferences, same-level > preference (ambivalence) allowed > (eg. place 1 for logos C and D, place 2 for A and place 3 for B) We recently had to vote for the new design of our university's website. This was done by asking every vo

Re: [Haskell-cafe] How do we decide on the new logo?

2009-01-02 Thread Henning Thielemann
Fritz Ruehr schrieb: > Without starting a war on the theory of voting systems, perhaps we > should use a system which allows for > a certain amount of secondary (etc.) preference to be expressed? Give everyone 10 points and let every voter assign these points to his favorite logos, where it is po

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Henning Thielemann
Miguel Mitrofanov schrieb: > module Element where > import QName > import ... > data Element = Element {name :: QName, attribs :: [Attr], content :: > [Content], line :: Maybe Line} > > module Attr where > import QName > import ... > data Attr = Attr {key :: QName, val :: String} > > module QNam

Re: [Haskell-cafe] Re: unsafeInterleaveIO respecting order of actions

2009-01-01 Thread Henning Thielemann
On Fri, 2 Jan 2009, Achim Schneider wrote: Henning Thielemann wrote: If it is generally possible to use unsafeInterleaveIO such that it executes actions in the right order, wouldn't this allow the definition of a general lazy IO monad? The question is what "right order" mea

Re: [Haskell-cafe] [ANN] Haskell web server + wiki: salvia-0.0.4 + orchid-0.0.6

2009-01-01 Thread Henning Thielemann
Sebastiaan Visser schrieb: > Happy new year, you all! > > I'm pleased to announce three new packages on Hackage: > > * salvia-0.0.4: A lightweight modular web server framework. Is it based on Simon Marlow's HWS, like mohws on Hackage? Does it support HTTPS? ___

Re: [Haskell-cafe] [ANN] Haskell web server + wiki: salvia-0.0.4 + orchid-0.0.6

2009-01-01 Thread Henning Thielemann
Judah Jacobson schrieb: > On Thu, Jan 1, 2009 at 10:39 AM, Sebastiaan Visser wrote: >> On Jan 1, 2009, at 7:15 PM, Gwern Branwen wrote: >>> On Thu, Jan 1, 2009 at 9:04 AM, Sebastiaan Visser wrote: Happy new year, you all! I'm pleased to announce three new packages on Hackage:

[Haskell-cafe] unsafeInterleaveIO respecting order of actions

2009-01-01 Thread Henning Thielemann
I think I have a very similar problem to the currently discussed "WriterT [w] IO is not lazy in reading [w]". I want to defer IO actions, until they are needed, but they shall be executed in order. If I call unsafeInterleaveIO, they can be executed in any order. I understand that hGetContents does

Re: [Haskell-cafe] Gitit - Encoding

2008-12-30 Thread Henning Thielemann
On Tue, 30 Dec 2008, Arnaud Bailly wrote: Hello, I have started using Gitit and I am very happy with it and eager to start hacking. I am running into a practical problem: characters encoding. When I edit pages using accented characters (I am french), the accents get mangled when the page come b

Re: [Haskell-cafe] Re: instance Enum [Char] where ...

2008-12-30 Thread Henning Thielemann
Justin Goguen schrieb: > My purpose is to have operations such as ["aa".."bc"] be possible, with its > result being ["aa", "ab", "ac" "ba", "bb", "bc"] ... what do you want to get, if the lengths of the start and the end string do not match? Maybe what you are after is the Ix class: Prelu

Re: [Haskell-cafe] Function composition

2008-12-30 Thread Henning Thielemann
On Mon, 29 Dec 2008, Martijn van Steenbergen wrote: Conal Elliott wrote: If you think of f (here f=not) as an "semantic editor" (transformer) of values, then 'result', 'first', and 'second' are "semantic editor combinators", which can be composed together arbitrarily. See http://conal.net/b

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-30 Thread Henning Thielemann
wren ng thornton schrieb: > Thomas DuBuisson wrote: >> Jeff Heard proclaimed: >> > There are multiple distinct reasons people use Show, and this gets >> > confusing. >> >> This is exactly what I was getting at. I see four uses being discussed: > > Indeed, though I think the situation is even wors

Re: [Haskell-cafe] Infinite grid

2008-12-29 Thread Henning Thielemann
Martijn van Steenbergen schrieb: > Hello, > > I would like to construct an infinite two-dimensional grid of nodes, > where a node looks like this: > >> data Node = Node >> { north :: Node >> , east :: Node >> , south :: Node >> , west :: Node >> } > > in such a way that for every nod

Re: [Haskell-cafe] Maintaining laziness

2008-12-29 Thread Henning Thielemann
Miguel Mitrofanov schrieb: > Seems useful. > > BTW, why on earth should "inits undefined" be "undefined" instead of > "[]:undefined"? I mean, come on, we all know that "inits anything" > starts with []! I don't know the reason, but I have added this example to that article. __

Re: [Haskell-cafe] Maintaining laziness

2008-12-29 Thread Henning Thielemann
Jake McArthur schrieb: > Henning Thielemann wrote: >> I found it especially enlightening, that one can avoid a 'force' >> function in a lazy parser by making the possibility of a parser >> failure explicit in its type. I.e. a parser that cannot fail, need no >>

[Haskell-cafe] Maintaining laziness

2008-12-29 Thread Henning Thielemann
In case someone cares - after some battles with functions that are less lazy than expected, I have written a tutorial on how to get functions lazy and how to test, whether they are actually lazy: http://www.haskell.org/haskellwiki/Maintaining_laziness I found it especially enlightening, that

Re: [Haskell-cafe] Function composition

2008-12-29 Thread Henning Thielemann
Luke Palmer schrieb: > 2008/12/26 Oscar Picasso > > > Hi, > > I can write: > *Main> let yes = not . not > *Main> :t yes > yes :: Bool -> Bool > > But not: > *Main> let isNotEqual = not . (==) > > > The definition of (.): > > f . g =

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Henning Thielemann
On Fri, 26 Dec 2008, Jeff Heard wrote: I don't think that making Show a type class was a mistake. I think that we have long since overloaded the meaning of Show and made it ambiguous. There are multiple distinct reasons people use Show, and this gets confusing. It would be good if we as a co

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Henning Thielemann
On Fri, 26 Dec 2008, Thomas DuBuisson wrote: Hello cafe, This is just a small thought, but its been bugging me.  We have these things called type classes for a reason (I like to think).  When making a new data type 'Data', it is not productive to avoid type classes such as 'Show' and export a

[Haskell-cafe] Hackage packages for indexing by Google

2008-12-25 Thread Henning Thielemann
When testing the ShowMeta parallel web: http://hackage.haskell.org.showmeta.parallelnetz.de/packages/archive/pkg-list.html I found, that all HackageDB pages forbid crawling and indexing. Actually, the content of this page is dynamic - but it changes only incrementally. It would be very wo

Re: [Haskell-cafe] monad constraint + record update

2008-12-23 Thread Henning Thielemann
Brent Yorgey schrieb: > On Mon, Dec 22, 2008 at 06:19:07PM +0100, Peter Padawitz wrote: >> I'd like to define a monad Set for types in the class Eq. But how can the >> arguments of Set be constrained when Set is defined as an instance of >> Monad? instance Eq a => Monad Set where ... obviously ca

Re: [Haskell-cafe] Defining a containing function on polymorphic list

2008-12-23 Thread Henning Thielemann
Andrew Wagner schrieb: > The problem here is even slightly deeper than you might realize. For > example, what if you have a list of functions. How do you compare two > functions to each other to see if they're equal? There is no good way > really to do it! So, not only is == not completely polymorp

Re: [Haskell-cafe] Comparing on multiple criteria

2008-12-23 Thread Henning Thielemann
David Menendez schrieb: > On Sun, Dec 21, 2008 at 11:20 AM, Jan-Willem Maessen > wrote: >> On Dec 21, 2008, at 8:52 AM, Martijn van Steenbergen wrote: >> >>> Hello all, >>> >>> Data.Ord has a handy function called comparing, and its documentation >>> shows an example of its use. >>> >>> But what i

Re: [Haskell-cafe] understanding enumerator/iteratee

2008-12-23 Thread Henning Thielemann
Jason Dusek schrieb: > Henning Thielemann wrote: >> Jason Dusek schrieb: >>> I'm taking a stab at composable streams, starting with >>> cursors. I managed to make a derived cursor today -- as I >>> work through this stuff, I hope to understand >>&g

Re: [Haskell-cafe] understanding enumerator/iteratee

2008-12-23 Thread Henning Thielemann
Jason Dusek schrieb: > I'm taking a stab at composable streams, starting with > cursors. I managed to make a derived cursor today -- as I work > through this stuff, I hope to understand Iteratee/Enumerator > better. How about a wiki page on the roles of enumerators and iteratees, best expl

Re: Fwd: [Haskell-cafe] Haskell as a religion

2008-12-18 Thread Henning Thielemann
Alberto G. Corona schrieb: > But many features need other features. For example, the option to use > referential transparency will be common in future languages for > multicore programming purposes. This creates the problem of separating > side-effect-free code from side-effect code. In C/C++ ref

Re: [Haskell-cafe] Time for a new logo? -> Haskell logo as a stamp!

2008-12-16 Thread Henning Thielemann
On Mon, 15 Dec 2008, Henning Thielemann wrote: On Mon, 15 Dec 2008, Don Stewart wrote: And anyone who does a version, place put it on the wiki. It'll be lost if you only post to the list. I propose we gather submissions and vote on the best for a new logo in 2009. Whatever logo so

Re: [Haskell-cafe] Time for a new logo? -> Haskell logo as a stamp!

2008-12-15 Thread Henning Thielemann
On Mon, 15 Dec 2008, Don Stewart wrote: And anyone who does a version, place put it on the wiki. It'll be lost if you only post to the list. I propose we gather submissions and vote on the best for a new logo in 2009. Whatever logo someone prefers: I have written a program using HPDF which

Re: [Haskell-cafe] Time for a new logo?

2008-12-15 Thread Henning Thielemann
On Sun, 14 Dec 2008, Don Stewart wrote: I noticed a new haskell logo idea on a tshirt today, http://image.spreadshirt.net/image-server/image/configuration/13215127/producttypecolor/2/type/png Simple, clean and *pure*. Instead of the "we got lots going on" of the current logo. Call me c

Re: [Haskell-cafe] efficient combination of foldl' and foldr -> foldl'r

2008-12-05 Thread Henning Thielemann
On Fri, 5 Dec 2008, Ryan Ingram wrote: You're testing the interpreted code, so it's not surprising that the naive version performs better; the interpretive overhead only applies to your bit of glue code. I wanted to avoid the optimizer to do clever things itself. Alternatively, at least com

Re: [Haskell-cafe] How to define Show [MyType] ?

2008-12-05 Thread Henning Thielemann
Jules Bean schrieb: > Dmitri O.Kondratiev wrote: >> I am trying to define instance Show[MyType] so >> show (x:xs :: MyType) would return a single string where substrings >> corresponding to list elements will be separated by "\n". >> This would allow pretty printing of MyType list in several lines

[Haskell-cafe] efficient combination of foldl' and foldr -> foldl'r

2008-12-05 Thread Henning Thielemann
I want to do a foldl' and a foldr in parallel on a list. I assumed it would be no good idea to run foldl' and foldr separately, because then the input list must be stored completely between the calls of foldl' and foldr. I wanted to be clever and implemented a routine which does foldl' and fo

Re: [Haskell-cafe] Combining licences

2008-12-01 Thread Henning Thielemann
On Mon, 1 Dec 2008, Emil Axelsson wrote: Or perhaps it's better to put the cell library in its own package? I'm a bit reluctant to do this, because it means that Wired will be essentially useless on its own. It's more the question, whether a Haskell wrapper to the cell library is useful on

Re: [Haskell-cafe] Cabal

2008-12-01 Thread Henning Thielemann
On Sun, 30 Nov 2008, Duncan Coutts wrote: On Sun, 2008-11-30 at 21:14 +0100, Henning Thielemann wrote: On Sun, 30 Nov 2008, Don Stewart wrote: lemming: Maybe you like to add a pointer in cabal-install.cabal/Homepage field to this page. Good idea. Duncan? After I finished that article

Re: [Haskell-cafe] Haskell, successing crossplatform API standart

2008-11-30 Thread Henning Thielemann
On Sun, 30 Nov 2008, Don Stewart wrote: Maybe it is time for a "Haskell for the Web" collection. Two days ago I initialized http://www.haskell.org/haskellwiki/Category:Web ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.o

Re: [Haskell-cafe] Cabal

2008-11-30 Thread Henning Thielemann
On Sun, 30 Nov 2008, Don Stewart wrote: lemming: Maybe you like to add a pointer in cabal-install.cabal/Homepage field to this page. Good idea. Duncan? After I finished that article, I also found: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall

Re: [Haskell-cafe] Cabal

2008-11-30 Thread Henning Thielemann
On Sun, 30 Nov 2008, Don Stewart wrote: *if* .. *might* .. *assuming* .. *potentially* .. *maybe* .. *if*.. You could have built it by now! Source: http://hackage.haskell.org/packages/archive/cabal-install/0.6.0/cabal-install-0.6.0.tar.gz Dependencies that aren't in core:

Re: [Haskell-cafe] Extensible Exceptions

2008-11-29 Thread Henning Thielemann
On Sun, 23 Nov 2008, Duncan Coutts wrote: On Sun, 2008-11-23 at 01:40 +0100, Henning Thielemann wrote: On Sat, 22 Nov 2008, Thomas Schilling wrote: It's a pattern match error, implemented by throwing an asynchronous exception. The idea being, that we only have one mechanism (wel

Re: [Haskell-cafe] Re: Go Haskell!

2008-11-28 Thread Henning Thielemann
On Fri, 28 Nov 2008, Johan Tibell wrote: On Fri, Nov 28, 2008 at 10:04 AM, Simon Marlow <[EMAIL PROTECTED]> wrote: So we have two vector libraries, vector and uvector, which have a lot in common - they are both single-dimension array types that support unboxed instances and have list-like ope

[Haskell-cafe] Re: Go Haskell! -> array libraries

2008-11-28 Thread Henning Thielemann
On Fri, 28 Nov 2008, Simon Marlow wrote: Manuel M T Chakravarty wrote: Claus Reinke: What do those folks working on parallel Haskell arrays think about the sequential Haskell array baseline performance? You won't like the answer. We are not happy with the existing array infrastructure and

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread Henning Thielemann
On Sat, 22 Nov 2008, Thomas Schilling wrote: It's a pattern match error, implemented by throwing an asynchronous exception. The idea being, that we only have one mechanism (well, an synchronous exceptions, thrown via throwIO). Yes, I know that there's a difference between "error" and "excepti

Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-22 Thread Henning Thielemann
On Sat, 22 Nov 2008, Janis Voigtlaender wrote: Definitely. And that surfaces even in quite innocently looking programs and statements about them. The introductory example of the following technical report may be amusing in that respect: http://wwwtcs.inf.tu-dresden.de/~voigt/TUD-FI08-08.pdf

Re: [Haskell-cafe] Extensible Exceptions

2008-11-22 Thread Henning Thielemann
On Sat, 22 Nov 2008, Thomas Schilling wrote: Be careful, though. This only works if there's a single constructor for your exception type. If there are multiple, you should write it like this: thing_to_try `catch` \(e :: MyErrorType) -> case e of MyError1 _ -> ..; MyError2 _ -> ... If you wr

Re: [Haskell-cafe] varargs zip

2008-11-21 Thread Henning Thielemann
On Fri, 21 Nov 2008, Jason Dusek wrote: It came up on IRC last night that there is no "generic" zip in Haskell. I decided to write one as an example, but it only half works. I think that the ZipList type for Applicative functors is a solution. http://www.haskell.org/ghc/docs/latest/html/l

Re: [Haskell-cafe] Pattern matching on numbers?

2008-11-18 Thread Henning Thielemann
On Tue, 18 Nov 2008, Ryan Ingram wrote: How does this work? fac n = case n of 0 -> 1 _ -> n * fac (n-1) ghci> :t fac fac :: (Num t) => t -> t The first line of "fac" pattern matches on 0. So how does this work over any value of the Num typeclass? I know that the "1" on the rhs of f

[Haskell-cafe] Re: OpenGL -> OGL

2008-11-17 Thread Henning Thielemann
On Sun, 16 Nov 2008, Neal Alexander wrote: Brent Yorgey wrote: --- ANN: OpenGL with extra type safety. Neal Alexander Hopefully the code will be uploaded to Hackage as a separate package soon. http://hackage.haskell.org/

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-14 Thread Henning Thielemann
Dan Piponi schrieb: > Real time audio applications are top of my list of "crazy projects I > would work on if I had a month spare". I think it might work out > nicely. My approach wouldn't be to talk directly to audio hardware > from Haskell but instead use a framework like Lava to generate low > l

Re: [Haskell-cafe] Re: What *not* to use Haskell for

2008-11-11 Thread Henning Thielemann
On Tue, 11 Nov 2008, Jefferson Heard wrote: Actually, one language you mention there *is* worse than the others for writing wrappable library code: C++. Admittedly, they've got a Python interface now via boost, but the main problem with writing wrappable C++ code is the template system and the

Re: [Haskell-cafe] Are arbitrary rank types and existentials equivalent?

2008-11-10 Thread Henning Thielemann
Ryan Ingram schrieb: > There's a natural relation between higher rank types and existentials; > one way to think about it is this: if you have some existential type t > (subject to some constraints), you cannot operate on it except with > some function that accepts any type t subject to those cons

Re: [Haskell-cafe] Convolution

2008-11-07 Thread Henning Thielemann
On Fri, 7 Nov 2008, Andrew Coppin wrote: A simple and straight-forward way to define the DSP operations of correlation and convolution is as follows: correlate1 :: [Double] -> [Double] -> Double correlate1 ks = sum . zipWith (*) ks correlate :: [Double] -> [Double] -> [Double] correlate ks [

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Henning Thielemann
Johannes Waldmann schrieb: > using strings (inside a program) to represent structured data > is wrong (*). > > of course you need strings for interfacing the "outside" world, > but the microsecond they get on the inside, > they should be tokenized and parsed away > into something useful (= an ab

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Henning Thielemann
Achim Schneider schrieb: > Henning Thielemann <[EMAIL PROTECTED]> wrote: >> >> There was >> http://www.haskell.org/haskellwiki/Things_to_avoid >> >> which has been renamed to the more friendly >> "Haskell programming tips" >>

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Henning Thielemann
Achim Schneider schrieb: > Derek Elkins <[EMAIL PROTECTED]> wrote: > >> well-known anti-patterns >> > I'm wondering why there are so miraculously well-known. Could it be the > dedicated wiki page titled "DONTDOTHAT!!!one!" that lists them > all? There was http://www.haskell.org/haskellwiki/Thi

Re: [Haskell-cafe] Problems with strictness analysis?

2008-11-03 Thread Henning Thielemann
On Mon, 3 Nov 2008, Luke Palmer wrote: On Mon, Nov 3, 2008 at 2:54 PM, Don Stewart <[EMAIL PROTECTED]> wrote: "Optimisations" enable strictness analysis. I was actually being an annoying purist. "f is strict" means "f _|_ = _|_", so strictness is a semantic idea, not an operational one. Op

Re: [Haskell-cafe] Array bug?

2008-11-03 Thread Henning Thielemann
On Mon, 3 Nov 2008, Svein Ove Aas wrote: On Mon, Nov 3, 2008 at 4:55 PM, Henning Thielemann I think it is a good idea to switch this feature on and off by a compiler switch. It does not alter the correctness of a program. If the program is incorrect, the switch does only affect the way how

Re: [Haskell-cafe] Array bug?

2008-11-03 Thread Henning Thielemann
On Mon, 3 Nov 2008, Svein Ove Aas wrote: On Sun, Nov 2, 2008 at 7:53 PM, Andrew Coppin In my opinion, what we should have is 1. An interface that is guaranteed-safe, no matter how inefficient that is. 2. An interface that is guaranteed-efficient, no matter how unsafe that is. 3. It should

Re: [Haskell-cafe] Re: Making 'community' server our social network

2008-11-03 Thread Henning Thielemann
On Mon, 3 Nov 2008, Mauricio wrote: Hello Maurí­cio, Monday, November 3, 2008, 4:43:26 AM, you wrote: darcs add .emacs darcs get http://code.haskell.org/MauricioAntunes thank, it's a great ideas! and don't forget that you can use code.haskell.org as online backup of history of your conf

Re: [Haskell-cafe] ANNOUNCE: zlib and bzlib 0.5 releases

2008-11-02 Thread Henning Thielemann
On Sun, 2 Nov 2008, Duncan Coutts wrote: The current error handling for decompression is not ideal. It just throws exceptions for failures like bad format or unexpected end of stream. This is a tricky area because error streaming behaviour does not mix easily with error handling. Maybe ht

Re: [Haskell-cafe] Newbie on instance of Monad

2008-10-31 Thread Henning Thielemann
On Fri, 31 Oct 2008, Jonathan Cast wrote: On Fri, 2008-10-31 at 18:43 -0200, Mauricio wrote: Hi, After a lot of thinking, I can't get what I am doing wrong in this code: -- data ( RandomGen g ) => RandomMonad g a = RandomMonad (g -> a) instance Monad (RandomMonad g) where return = Ra

Re: [Haskell-cafe] Newbie on instance of Monad

2008-10-31 Thread Henning Thielemann
On Fri, 31 Oct 2008, Mauricio wrote: Hi, After a lot of thinking, I can't get what I am doing wrong in this code: -- data ( RandomGen g ) => RandomMonad g a = RandomMonad (g -> a) RandomGen g is considered the constraint for the application of RandomMonad constructor, but GHC does not

Re: [Haskell-cafe] HDBC Oracle bindings(?/!)

2008-10-30 Thread Henning Thielemann
On Thu, 30 Oct 2008, Thiago Arrais wrote: Are there Oracle bindings for HDBC anywhere? The HDBC project page talks about Oracle backends but there isn't an Oracle-specific driver listed (I assume one can reach an Oracle backend through the ODBC interface?). I started writing Oracle bindings fo

Re: [Haskell-cafe] [Somewhat OT] Speed

2008-10-28 Thread Henning Thielemann
On Tue, 28 Oct 2008, Andrew Coppin wrote: Hi guys. This isn't specifically to do with Haskell, but... does anybody have any idea roughly how fast various CPU operations are? Unfortunately, the knowledge I acquired for Z80 and MC68000 is no longer of that importance today. It's still true

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Henning Thielemann
On Mon, 27 Oct 2008, Janis Voigtlaender wrote: Lennart Augustsson wrote: I can't remember the method being called anything. It was just what we were being taught. With the obvious explanation that .5 is right in the middle so always going one way would introduce a bias. This was circa 1969.

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Henning Thielemann
On Mon, 27 Oct 2008, Ketil Malde wrote: Of course, Haskell should discard the rather tasteless IEEE754 crud, and do its calculations on infinite streams of digits. Then, rounding upwards after 'take'ing a sufficient amount of decimals will be the right thing to do. When I implemented just th

Re: [Haskell-cafe] Re: Why 'round' does not just round numbers ?

2008-10-27 Thread Henning Thielemann
On Mon, 27 Oct 2008, L.Guo wrote: And then, in haskell, is that means, I have to use 'floor . (.5+)' instead of 'round' to get the common round function ? That's certainly the best to do. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http:/

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Henning Thielemann
On Mon, 27 Oct 2008, Daniel Fischer wrote: Am Montag, 27. Oktober 2008 11:46 schrieb Henning Thielemann: On Mon, 27 Oct 2008, Janis Voigtlaender wrote: Henning Thielemann wrote: I think one reason is that repeated rounding should not be worse than rounding in one go. Consider the rule 

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Henning Thielemann
On Mon, 27 Oct 2008, Janis Voigtlaender wrote: Henning Thielemann wrote: I think one reason is that repeated rounding should not be worse than rounding in one go. Consider the rule 'use ceiling when the first removed digit is 5'. Then 0.45 - (round to one place) -> 0.5 - (rou

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Henning Thielemann
On Mon, 27 Oct 2008, Janis Voigtlaender wrote: Henning Thielemann wrote: On Mon, 27 Oct 2008, L.Guo wrote: I think this is unresonable. then try it in GHC 6.8.3. Prelude> round 3.5 4 Prelude> round 2.5 2 Is there any explanation about that ? It's the definition we learn

Re: [Haskell-cafe] Instances of Lattice?

2008-10-27 Thread Henning Thielemann
On Sun, 26 Oct 2008, Galchin, Vasili wrote: Hi Henning, I am rereading my emails and I don't believe I got an examples of "instance Lattice". E.g. instance Lattice Bool. ?? Did you look into the Lattice module? Bool with respect to && and || Sets with respect to union and intersection (a

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Henning Thielemann
On Mon, 27 Oct 2008, L.Guo wrote: I think this is unresonable. then try it in GHC 6.8.3. Prelude> round 3.5 4 Prelude> round 2.5 2 Is there any explanation about that ? It's the definition we learnt in school ... I think one reason is that repeated rounding should not be worse than roun

Re: [Haskell-cafe] Examples of Mutually Recursive Types

2008-10-26 Thread Henning Thielemann
On Sun, 26 Oct 2008, Hugo Pacheco wrote: Hi all, I have been searching for examples of Haskell "real scenarios" that employ mutually recursive datatype definitions. Does anyone know some interesting libraries or structures that I could play with? http://darcs.haskell.org/wraxml/src/Data/Tree/

Re: [Haskell-cafe] problem using ST monad

2008-10-26 Thread Henning Thielemann
On Sat, 25 Oct 2008, Paul L wrote: I'm have some trouble using the ST monad, and I think I'm confused about its use of existential type. {-# OPTIONS -XRankNTypes #-} import Control.Monad.ST import Data.Array.ST I want to implement a map function that unfold all ST monads in a list: mapST

Re: [Haskell-cafe] hackage feature request: revision control location

2008-10-24 Thread Henning Thielemann
On Fri, 24 Oct 2008, zooko wrote: Hi folks: I'm trying to use hackage/cabal/cabal-install, and I have a feature request: it would be nice if the metadata about the package, which is displayed on e.g. "hackage-scripts/package/HTTP" had a field for the revision control tool that is used on th

Re: [Haskell-cafe] universal algebra "support" in Haskell?

2008-10-24 Thread Henning Thielemann
On Fri, 24 Oct 2008, Galchin, Vasili wrote: I "cabal installed" numeric-prelude .. however, unlike other packages(e.g. Sqlite3), I am unable to ":m numeric-prelude" in a ghci session.?? ':m' is for importing modules not packages, at least up to GHC-6.8.2. For playing around with the package

Re: [Haskell-cafe] universal algebra "support" in Haskell?

2008-10-23 Thread Henning Thielemann
On Thu, 23 Oct 2008, Galchin, Vasili wrote: I see that there is a "Monoid" class from Data.Monoid. What other algebras like Group, Ring, etc. have support in Haskell? http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numeric-prelude/ __

Re: [Haskell-cafe] package question/problem

2008-10-19 Thread Henning Thielemann
On Sat, 18 Oct 2008, Duncan Coutts wrote: On Fri, 2008-10-17 at 18:23 -0500, Galchin, Vasili wrote: Hello, I am trying to "cabal install" HSQL. I am using ghc 6.8.2. The simple answer is that the package is unmaintained and has not been updated to work with ghc 6.8.x. As far as I know

Re: [Haskell-cafe] Rewrite rules

2008-10-16 Thread Henning Thielemann
On Thu, 16 Oct 2008, George Pollard wrote: However, in the case he has written about this won't fire, since the LHS cannot be substituted as `cycle list` is used more than once: let rlist = cycle list print ( rlist !! (10^9), rlist !! 0 ) I can get it to fire again if I write it like this:

Re: [Haskell-cafe] Re: Repair to floating point enumerations?

2008-10-16 Thread Henning Thielemann
On Wed, 15 Oct 2008, David Roundy wrote: On Wed, Oct 15, 2008 at 11:25:57PM +0200, Henning Thielemann wrote: David Roundy schrieb: Why not look for a heuristic that gets the common cases right, rather than going with an elegant wrong solution? After all, these enumerations are most often

Re: [Haskell-cafe] 2008-10-13 Hackage status with GHC 6.10 release candidate

2008-10-15 Thread Henning Thielemann
Don Stewart schrieb: > numeric-prelude-0.0.4 > Easy: Lanuage pragma My question was still not answered: I used the non-existing pragma LANGUAGE_HOW_CAN_WE_ENABLE - I hoped it would be ignored, but it was parsed and made GHC fail. Why? Bug or feature? __

[Haskell-cafe] Re: Repair to floating point enumerations?

2008-10-15 Thread Henning Thielemann
David Roundy schrieb: > Why not look for a heuristic that gets the common cases right, rather > than going with an elegant wrong solution? After all, these > enumerations are most often used by people who neither care nor know > how they're implemented, but who most likely would prefer if haskell

Re: [Haskell-cafe] Flexible instances

2008-10-15 Thread Henning Thielemann
George Pollard schrieb: > I'm a little confused. Why is this allowed: > >> data Blah = Blah >> >> instance Eq Blah where >> x == y = True > > But not this: > >> class Stringable a where >> toString :: a -> String >> >> instance Stringable [Char] where >> toString = id >

Re: [Haskell-cafe] Improving MTL instances (was: Overlapping/Incoherent instances)

2008-10-15 Thread Henning Thielemann
Ryan Ingram schrieb: > On Mon, Oct 13, 2008 at 2:04 AM, J. Garrett Morris > <[EMAIL PROTECTED]> wrote: >> Indeed - MTL seems to have been rewritten at some point in the past to >> prefer exhaustive enumeration to overlap. > > Indeed, and I actually think this is a weakness of the current > impleme

Re: [Haskell-cafe] Constraints at construction

2008-10-12 Thread Henning Thielemann
On Thu, 9 Oct 2008, Iain Barnett wrote: If I were to create an object in C#, for instance, I could add code to the constructor that might limit the type further e.g. public class Car { string model; int wheels; public Car ( string model, int no_of_wheels ) {

Re: [Haskell-cafe] MPFR / FFI - Nefarious (Simple?) bug

2008-10-06 Thread Henning Thielemann
On Sun, 5 Oct 2008, Jared Updike wrote: In order to create an arbitrary precision floating point / drop in replacement for Double, I'm trying to wrap MPFR (http://www.mpfr.org/) using the FFI but despite all my efforts the simplest bit of code doesn't work. Don't forget to add it to http:/

Re: [Haskell-cafe] Re: Random question

2008-10-05 Thread Henning Thielemann
On Sun, 5 Oct 2008, Iain Barnett wrote: I just wanted to say thanks to everyone that helped me on this. I'm still reading/cogitating the stuff you gave me, but I did manage to write a Fisher-Yates shuffle using random numbers. I had a lightbulb moment while reading about sequence (so I suppos

Re: [Haskell-cafe] Stacking monads

2008-10-05 Thread Henning Thielemann
On Thu, 2 Oct 2008, Andrew Coppin wrote: Consider the following beautiful code: run :: State -> Foo -> ResultSet State run_and :: State -> Foo -> Foo -> ResultSet State run_and s0 x y = do s1 <- run s0 x s2 <- run s1 y return s2 run_or :: State -> Foo -> Foo -> ResultSet State run_or s

Re: [Haskell-cafe] Restricted file reading monad

2008-10-04 Thread Henning Thielemann
On Thu, 2 Oct 2008, George Pollard wrote: Hello all, I'm currently working on a (toy) ID3 [1] tag reader, which made me think of a library which might be quite useful. The structure of an ID3 tag goes something like this: Header: - total size of tag - other header info A series of frames, ea

RE: [Haskell-cafe] Hackage Build Failures

2008-10-04 Thread Henning Thielemann
On Wed, 1 Oct 2008, Mitchell, Neil wrote: The error comes from using QuickCheck 2, which happens to also use the operator (><). I can see two ways to solve the problem: (1) Add "< 2" after "QuickCheck" in the Wired.cabal file. (2) Add "hiding ((><))" after "import Test.QuickCheck" in Data/H

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Henning Thielemann
On Tue, 30 Sep 2008, wman wrote: Thanks a lot, I've had a hunch it was possible to get rid of those those liftM's. I turned it into: (writeFile "output.csv") . printCSV . (map updateLine) . (either (error "Chyba pri cteni CSV.") id) =<< parseCSVFromFile "input.csv" You may even remove paren

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Henning Thielemann
On Tue, 30 Sep 2008, wman wrote: I got asked how to do one particular thing in excel, which led to discssion with "our local MSOffice expert". During the discussion I stated that's it too much of a PITA and that I'd rather write a script. Long story short, I promised him a one-liner to "show th

Re: [Haskell-cafe] state monad and continuation monads ...

2008-09-30 Thread Henning Thielemann
On Tue, 30 Sep 2008, Galchin, Vasili wrote: Hello, I would like to read 1) pedagogical examples of State monad and the Continuation monad 2) library usage of these monads For continuations I found the withCString example especially convincing: http://www.haskell.org/haskellwi

Re: [Haskell-cafe] Re: 'par' - why has it the type a -> b -> b ?

2008-09-29 Thread Henning Thielemann
On Mon, 29 Sep 2008, Sean Leather wrote: (\x y -> y) *shudder* I just can't stand such things. What is it that you can't stand? Would you prefer "flip const"? No, certainly "const id". :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] 'par' - why has it the type a -> b -> b ?

2008-09-29 Thread Henning Thielemann
What is the reason for implementing parallelism with 'par :: a -> b -> b'? Analogy to 'seq'? I thought parallelism would be introduced most naturally by a function which does two computations in parallel and puts together their results after completion. Say par2 :: (a -> b -> c) -> (a -> b

Re: [Haskell-cafe] bug in number reading?

2008-09-28 Thread Henning Thielemann
On Sun, 28 Sep 2008, Brandon S. Allbery KF8NH wrote: On 2008 Sep 28, at 18:42, Jason Dusek wrote: Maybe I'm missing something, but this doesn't seem right... :; ghc -e '10e4' :1:0: Warning: Defaulting the following constraint(s) to type `Double' `Fractional a' arising from a use

Re: [Haskell-cafe] Problem with existential quantification

2008-09-25 Thread Henning Thielemann
On Thu, 25 Sep 2008, David Menendez wrote: That looks like it should work. I'm guessing you enabled ExistentialQuantification, but not Rank2Types or RankNTypes. The former allows you to use the forall keyword in data declarations, but you need one of the others to allow universal quantification

Re: [Haskell-cafe] if - then - else layout

2008-09-25 Thread Henning Thielemann
On Wed, 24 Sep 2008, leledumbo wrote: consider this partial program: if n>5 then putStrLn "big" else putStrLn "small" this works fine in hugs, but in ghc I must change it to: if n>5 then putStrLn "big" else putStrLn "small" maybe related http://www.haskell.org/haskellwiki/If-then

<    5   6   7   8   9   10   11   12   13   14   >