Re: [Haskell-cafe] It matters how Type Synonyms are defined?

2007-02-02 Thread J. Garrett Morris
Agreed. I've written quite a bit of code that way myself. Looking at Iavor's monadLib, though, raised a question: has there been any consider of removing the requirement that the newtype be the last argument? The classes for state monads, etc. are rather backwards as it is, since the independen

[Haskell-cafe] Alternate instance Show (Maybe a)?

2007-02-02 Thread Sergey Zaharchenko
Hello list, Suppose I want show Nothing to return "", and show (Just foo) return show foo. I don't seem to be able to. Looks like I either have to use some other function name, like `mShow', or have to import Prelude hiding Maybe, reimplement Maybe, write all the other useful instances (Functor, M

[Haskell-cafe] Suggestions for a hReadUntilStr implementation

2007-02-02 Thread Matt Revelle
Hey there, A few weeks back I was thinking of writing a Haskell program that automated a telnet session. One function that could be useful is a hReadUntilStr - that is, a function that takes a Handle as an input source, a String to match, and a "Num a" as the number of seconds to wait before re

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-02-02 Thread Kirsten Chevalier
On 1/28/07, Alexy Khrabrov <[EMAIL PROTECTED]> wrote: How do people stumble on Haskell? I was thinking that my story wasn't particularly interesting, but then again, I may be the only person on this list who can actually give a properly-cited publication as an answer to the question "how did yo

Re: [Haskell-cafe] It matters how Type Synonyms are defined?

2007-02-02 Thread John Meacham
On Fri, Feb 02, 2007 at 04:18:19PM -0600, Bryan Burgers wrote: > Now, I was going to ask something like, "How can I define my type > synonym so I can do this," but I figured out while writing this email > that if I define ScopeState a different way: > >type ScopeState = State (Scope VVar) this is

RE: [Haskell-cafe] It matters how Type Synonyms are defined?

2007-02-02 Thread Simon Peyton-Jones
Type synonyms are like type level functions. So long as they are fully applied, the type checker can treat them like macros, and expand them at compile time. But if they are only partially applied, it can't. Allowing full functions at the type level makes type inference practically impossible

[Haskell-cafe] It matters how Type Synonyms are defined?

2007-02-02 Thread Bryan Burgers
Today, I was plugging away on a program and I ran into a problem. It seems that ErrorT can or can not take a type synonym as its monad, depending on how the type synonym was defined. For example, consider this GHCi interactive run: :k Maybe Maybe :: * -> * let { a :: ErrorT String Maybe Bool;

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-02-02 Thread J. Garrett Morris
On 1/28/07, Alexy Khrabrov <[EMAIL PROTECTED]> wrote: How do people stumble on Haskell? My story isn't as interesting as some of these. My first quarter in school, I took a course taught in Scheme. I expressed some dissatisfaction with the lack of types (and, in particular, the collection of

Re: [Haskell-cafe] Levels of recursion

2007-02-02 Thread J. Garrett Morris
On 1/31/07, Andrew Wagner <[EMAIL PROTECTED]> wrote: So, a couple of questions to ponder about this: Is this unique to Haskell, or could the same be said about any functional language? How can we teach this better to newbies? Most of what I see in the tutorials is "Higher order functions accept

Re: [Haskell-cafe] (a -> [b]) vs. [a -> b]

2007-02-02 Thread J. Garrett Morris
Uh, apologies. I got confused between reading your post and playing for a while, and answered the wrong question. /g On 2/2/07, J. Garrett Morris <[EMAIL PROTECTED]> wrote: On 2/2/07, Chad Scherrer <[EMAIL PROTECTED]> wrote: > So in reality, I'm trying to construct something like > f :: (a ->

Re: [Haskell-cafe] "Write Yourself a Scheme in 48 Hours"

2007-02-02 Thread Shannon -jj Behrens
On 2/1/07, Bryan O'Sullivan <[EMAIL PROTECTED]> wrote: Shannon -jj Behrens wrote: > I'm going through the "Write Yourself a Scheme in 48 Hours" > > > tutorial. I like it a lot, but I have some concerns. Are the > exer

Re: [Haskell-cafe] (a -> [b]) vs. [a -> b]

2007-02-02 Thread J. Garrett Morris
On 2/2/07, Chad Scherrer <[EMAIL PROTECTED]> wrote: So in reality, I'm trying to construct something like f :: (a -> STM b) -> STM (a -> b) I just figured it was a general monadic kind of problem, more simply expressed using lists. But the (!!) solution doesn't make sense in this context. Perh

Re: [Haskell-cafe] Become a GHC build slave!

2007-02-02 Thread dgriffi3
On Fri, Feb 02, 2007 at 04:37:41PM +, Simon Marlow wrote: Thanks largely to Ian Lynagh, GHC now has a BuildBot infrastructure to automate nightly builds on multiple platforms. This replaces the old set of shell scripts that we used to run nightly builds; now adding new clients to the setup

Re: [Haskell-cafe] strict bytestring fun

2007-02-02 Thread Bertram Felgenhauer
Donald Bruce Stewart wrote: > High performance strings on the shootout: > > http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=all > > interesting alternative programs > 0.5 Haskell GHC #5 1.2990,880270 > > 1.0 Clean 2.77

Re: [Haskell-cafe] (a -> [b]) vs. [a -> b]

2007-02-02 Thread Chad Scherrer
Oops, I thought I had sent a response to the cafe, but it looks like it just went to Matthew. Unfortunately, I was trying to give a simplification of the real problem, where the monad is STM instead of []. Based on apfelmus's observation of why they can't be isomorphic, I'm guessing I'm out of lu

[Haskell-cafe] Become a GHC build slave!

2007-02-02 Thread Simon Marlow
Thanks largely to Ian Lynagh, GHC now has a BuildBot infrastructure to automate nightly builds on multiple platforms. This replaces the old set of shell scripts that we used to run nightly builds; now adding new clients to the setup is relatively easy, instructions are here: http://hackage.

Re: [Haskell-cafe] A distributed and replicating native Haskell database

2007-02-02 Thread Rich Neswold
On 2/2/07, Joel Reymont <[EMAIL PROTECTED]> wrote: Would it make sense to build a similar type of a database for Haskell? What do you think? I used mnesia in a little Erlang project I did. It did nearly everything I wanted it to (and stuff I didn't need since it does replication and my project

Re: [Haskell-cafe] Re: Boost equivalent

2007-02-02 Thread Justin Bailey
On 2/1/07, Slavomir Kaslev <[EMAIL PROTECTED]> wrote: would be sweet. Even sweeter is easily accessing .Net Framework from ghc, especially for Windows users. .Net Framework is huge. It is de-facto _the_ windows framework. Are there any projects going in this direction? I would so love to see th

Re: [Haskell-cafe] A distributed and replicating native Haskell database

2007-02-02 Thread Joel Reymont
On Feb 2, 2007, at 3:06 PM, Paul Johnson wrote: As a rule, storing functions along with data is a can of worms. Either you actually store the code as a BLOB or you store a pointer to the function in memory. Either way you run into problems when you upgrade your software and expect the stor

Re: [Haskell-cafe] A distributed and replicating native Haskell database

2007-02-02 Thread Paul Johnson
Joel Reymont wrote: Folks, Allegro Common Lisp has AllegroCache [1], a database built on B-Trees that lets one store Lisp objects of any type. You can designate certain slots (object fields) as key and use them for lookup. ACL used to come bundled with the ObjectStore OODBMS for the same purp

Re: [Haskell-cafe] Array copy performance

2007-02-02 Thread Duncan Coutts
On Fri, 2007-02-02 at 17:02 +0300, Bulat Ziganshin wrote: > Hello Chris, > > Friday, February 2, 2007, 4:44:37 PM, you wrote: > > > If I have two identical STUArrays (same type and bounds) then what is the > > most > > efficient way to overwrite the data in the destination with the data in the >

[Haskell-cafe] A distributed and replicating native Haskell database

2007-02-02 Thread Joel Reymont
Folks, Allegro Common Lisp has AllegroCache [1], a database built on B-Trees that lets one store Lisp objects of any type. You can designate certain slots (object fields) as key and use them for lookup. ACL used to come bundled with the ObjectStore OODBMS for the same purpose but then ado

Re: [Haskell-cafe] Array copy performance

2007-02-02 Thread Bulat Ziganshin
Hello Chris, Friday, February 2, 2007, 4:44:37 PM, you wrote: > If I have two identical STUArrays (same type and bounds) then what is the most > efficient way to overwrite the data in the destination with the data in the > source? Does this work for STArrays? > Is there a way to avoid the long

[Haskell-cafe] Timezone Database Library

2007-02-02 Thread Martin Percossi
Hello, is there a haskell library that provides facilities to read and use the tzfile format [1], or equivalent in Windows? TIA Martin [1] http://www.twinsun.com/tz/tz-link.htm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.

[Haskell-cafe] Re: snd and tuples of various sizes...

2007-02-02 Thread Max Vasin
> "Mattias" == Mattias Bengtsson <[EMAIL PROTECTED]> writes: Mattias> On Thu, 2007-02-01 at 21:01 -1000, Tim Newsham wrote: >> instance Second [a] a where snd [] = error "don't got none" snd >> (x:y:xs) = y Mattias> Would'nt that instance mean this: snd [] produces error Mattias> snd [x] give

[Haskell-cafe] Array copy performance

2007-02-02 Thread Chris Kuklewicz
Hi, I am trying to improve the memory usage of regex-tdfa and I wanted to ask an array question. If I have two identical STUArrays (same type and bounds) then what is the most efficient way to overwrite the data in the destination with the data in the source? Does this work for STArrays? Is th

Re: [Haskell-cafe] snd and tuples of various sizes...

2007-02-02 Thread Andreas Farre
Mattias Bengtsson wrote: > On Thu, 2007-02-01 at 21:01 -1000, Tim Newsham wrote: >> instance Second [a] a where >> snd [] = error "don't got none" >> snd (x:y:xs) = y > > Would'nt that instance mean this: > snd [] produces error > snd [x] gives [] > > > I'd implement it something lik

Re: [Haskell-cafe] snd and tuples of various sizes...

2007-02-02 Thread Mattias Bengtsson
On Thu, 2007-02-01 at 21:01 -1000, Tim Newsham wrote: > instance Second [a] a where > snd [] = error "don't got none" > snd (x:y:xs) = y Would'nt that instance mean this: snd [] produces error snd [x] gives [] I'd implement it something like this (if this works?): instance Second

[Haskell-cafe] Re: Let's welcome the Ruby hackers!

2007-02-02 Thread apfelmus
Alexis wrote: > In contrast with other IT-related communities i've experienced, > i've found the Haskell community (both here and on IRC) to generally be > helpful, good-humoured and mercifully lacking in flames and alpha > behaviours. :-) I have to reject this claim because there are quite man

[Haskell-cafe] ANN: Takusen 0.6

2007-02-02 Thread Alistair Bayley
We are pleased to announce a new release of Takusen. There are a large number of changes and bug-fixes: - Oracle support for processing cursors returned from procedure calls - withContinuedSession supports connection reuse (e.g. for persistent connections and connection pooling) - new README file

Re: [Haskell-cafe] Channel9 Interview: Software Composability andthe Future of Languages

2007-02-02 Thread Chris Kuklewicz
Claus Reinke wrote: while (hGetBuf h buf bufsize == bufsize) crc := updateCrc crc buf bufsize break if crc==0 print crc >> >>> inContT $ callCC $ \break -> do >>> flip execStateT 0 $ do >>> whileM (liftM (== bufsize) (hGetBuf h buf bufsize)) $ do

Re: [Haskell-cafe] Re: Boost equivalent

2007-02-02 Thread Paul Moore
On 01/02/07, Slavomir Kaslev <[EMAIL PROTECTED]> wrote: Even sweeter is easily accessing .Net Framework from ghc, especially for Windows users. .Net Framework is huge. It is de-facto _the_ windows framework. Are there any projects going in this direction? That would indeed be nice - it would ma

Re: [Haskell-cafe] (a -> [b]) vs. [a -> b]

2007-02-02 Thread Yitzchak Gale
Chad Scherrer wrote: Are (a -> [b]) and [a -> b] isomorphic? I'm trying to construct a function f :: (a -> [b]) -> [a -> b] that is the (at least one-sided) inverse of f' :: [a -> b] -> a -> [b] f' gs x = map ($ x) gs Anything better than this? f g = [\x -> g x !! n | n <- [0..]] -Yitz ___