[Haskell-cafe] Re: [Haskell-beginners] folds -- help!

2009-03-14 Thread Adrian Neumann
That's why I said for appropriate g and f. But I see that my wording was misleading. However you can say: foldl' oplus alpha bs =(foldr f id bs) alpha where f a g = \alpha - g (alpha `oplus` a) foldr' oplus alpha bs = (foldl f id bs) alpha where f g a = \alpha - g (a `oplus`

Re: [Haskell-cafe] State monad is missing Applicative instance

2009-03-14 Thread Peter Verswyvelen
I was using the transformers but still had to implement the Applicative instance of State This package contains an applicative instance for StateT but not for State On Sat, Mar 14, 2009 at 3:05 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Thu, 12 Mar 2009, Peter Verswyvelen

Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Peter Verswyvelen
On Sat, Mar 14, 2009 at 2:36 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: a lot. However, isn't this halfheartedly since we all wait for full dependent types? :-) Well, in C++ one can already use the numerical values with templates for achieving a lot of compile time

Re: [Haskell-cafe] ANNOUNCE: Vintage BASIC 1.0

2009-03-14 Thread Lyle Kopnicky
I've posted a new version, 1.0.1, that has a usage message if you run it with no arguments. There is a package for Windows now (not just a binary) as well as Linux. Both packages include documentation and example programs. Thanks for pointing that out! On Fri, Mar 13, 2009 at 1:31 AM, Wolfgang

[Haskell-cafe] Problem with cabal-install where package requires* mutually exclusive versions of another package

2009-03-14 Thread Mark Wassell
I am trying install a package using cabal-install however the package requies an older version of QuickCheck and one of the required packages requires the latest version: $ cabal fetch Reactive Resolving dependencies... cabal.exe: cannot configure Stream-0.3.1. It requires QuickCheck =2.0 For

[Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Colin Paul Adams
I'm getting a runtime failure Error in array index. This causes ghci to exit. Is there a way to get it to break instead, so I can find out which function is failing? -- Colin Adams Preston Lancashire ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Vim support for cabal

2009-03-14 Thread Pavel Perikov
Great ! I'm just starting with Vim so I'm not sure if I could contribute. But I definitely will look into the sources. Thanks! Pavel On 13.03.2009, at 21:44, andy morris wrote: 2009/3/13 Pavel Perikov peri...@gmail.com: Hi café ! I googled for some kind of vim support for cabal but found

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-14 Thread Daniel Peebles
I have added UAProd-based Binary instances to my copy of the uvector repo at http://patch-tag.com/publicrepos/pumpkin-uvector . I have some extensive tests (added to the existing tests directory) of things in there and they seem to be mostly sane. The Binary code isn't at all pretty right now,

Re: [Haskell-cafe] Style Guide for Haskell Code

2009-03-14 Thread Martijn van Steenbergen
Henning Thielemann wrote: Of course, style is a matter of taste. So there are as many good styles as programmers and there won't be an official style guide, I'm afraid. While that is true, it's no valid reason to not have a style guide. Sun's style guide for Java has been very successful,

Re: [Haskell-cafe] Re: Haskell-Wiki Account registration

2009-03-14 Thread Martijn van Steenbergen
Benjamin L.Russell wrote: Why not ask new users to identify letters in a random bitmapped image of a string, as is commonly done? Then any new user who still registers and starts submitting spam can be tracked and moderated. If this doesn't work out we can always use hackage's approach: have

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Bulat Ziganshin
Hello Colin, Saturday, March 14, 2009, 11:39:41 AM, you wrote: I'm getting a runtime failure Error in array index. This causes ghci to exit. Is there a way to get it to break instead, so I can find out which function is failing? i recall two techniques - one is trivially define your own

[Haskell-cafe] Re: Haskell-Wiki Account registration

2009-03-14 Thread Ashley Yakeley
Henning Thielemann wrote: How long will the Wiki account registration be disabled? Would it be possible to ask a question, that real Haskellers could easily answer, but a spambot cannot? E.g. What's Haskell's surname? It will be re-enabled when an appropriate extension to MediaWiki is

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Adrian Neumann
You can use the ghci debugger http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci- debugger.html it can set breakpoints on exceptions. Am 14.03.2009 um 09:39 schrieb Colin Paul Adams: I'm getting a runtime failure Error in array index. This causes ghci to exit. Is there a way

[Haskell-cafe] darcs fundraising drive - only $720 left to go!

2009-03-14 Thread Eric Kow
Hi everybody, Just a quick update on the fundraising drive. We are trying to raise $1000 to help pay for travel to the upcoming Haskell hackathon (the second of our biannual darcs hacking sprints). So far we have raised $280, so we're almost a third of the way there. Think you can help? Details

[Haskell-cafe] Hashing over equivalence classes

2009-03-14 Thread Roman Cheplyaka
Are there some known ways to define hashing (or any other) functions over equivalence classes? I.e. a ~ b = hash(a) == hash(b) where (~) is some equivalence relation. For example, you might want to hash lambda terms modulo alpha-equivalence or hash logical terms with respect to commutativity

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Claus Reinke
I'm getting a runtime failure Error in array index. This causes ghci to exit. Is there a way to get it to break instead, so I can find out which function is failing? i recall two techniques - one is trivially define your own (!) and print index at least. another is to use ghc profiling with

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-14 Thread Manlio Perillo
Daniel Peebles ha scritto: I have added UAProd-based Binary instances to my copy of the uvector repo at http://patch-tag.com/publicrepos/pumpkin-uvector . I have some extensive tests (added to the existing tests directory) of things in there and they seem to be mostly sane. Thanks for the

Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Conor McBride
Hi Henning On 14 Mar 2009, at 01:36, Henning Thielemann wrote: On Tue, 10 Mar 2009, Conor McBride wrote: Apologies for crossposting. Please forward this message to individuals or lists who may be interested. In addition to the recently advertised PhD position at Strathclyde on Reusability

Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Wolfgang Jeltsch
Am Samstag, 14. März 2009 08:19 schrieb Peter Verswyvelen: Well, in C++ one can already use the numerical values with templates for achieving a lot of compile time computations. So I would be very happy to have this feature in Haskell. It might also be good research towards full dependent

[Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Grzegorz Chrupala
Hi all, Is there a serialization library other than the Data.Binary from hackage? I am using Data.Binary in a couple of projects, but I have found its stack and memory usage very hard to control. Its very common that decoding a map or list of non-trivial size uses up all available RAM, or causes

[Haskell-cafe] Re: Haskell-Wiki Account registration

2009-03-14 Thread Achim Schneider
Henning Thielemann lemm...@henning-thielemann.de wrote: On Fri, 13 Mar 2009, Benjamin L.Russell wrote: Why not ask new users to identify letters in a random bitmapped image of a string, as is commonly done? I assume, because those images are 1) not accessible by blind people 2)

[Haskell-cafe] Re: Alternative to Data.Binary

2009-03-14 Thread ChrisK
Grzegorz Chrupala wrote: Hi all, Is there a serialization library other than the Data.Binary from hackage? Yes. binary-strict is one alternative: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/binary-strict I am using Data.Binary in a couple of projects, but I have found

Re: [Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Svein Ove Aas
On Sat, Mar 14, 2009 at 1:37 PM, Grzegorz Chrupala grzegorz.chrup...@computing.dcu.ie wrote: Hi all, Is there a serialization library other than the Data.Binary from hackage? I am using Data.Binary in a couple of projects, but I have found its stack and memory usage very hard to control. Its

Re: [Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Manlio Perillo
Svein Ove Aas ha scritto: On Sat, Mar 14, 2009 at 1:37 PM, Grzegorz Chrupala grzegorz.chrup...@computing.dcu.ie wrote: Hi all, Is there a serialization library other than the Data.Binary from hackage? I am using Data.Binary in a couple of projects, but I have found its stack and memory usage

Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Conor McBride
Hi Wolfgang On 14 Mar 2009, at 12:00, Wolfgang Jeltsch wrote: Am Samstag, 14. März 2009 08:19 schrieb Peter Verswyvelen: Well, in C++ one can already use the numerical values with templates for achieving a lot of compile time computations. So I would be very happy to have this feature in

[Haskell-cafe] Haskell Weekly News: Issue 109 - March 14, 2009

2009-03-14 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090314 Issue 109 - March 14, 2009 --- Welcome to issue 109 of HWN, a newsletter covering

Re: [Haskell-cafe] Re: [Haskell-beginners] folds -- help!

2009-03-14 Thread John Dorsey
Adrian, That's why I said for appropriate g and f. But I see that my wording was misleading. Thanks for following up! I had thought you were arguing that foldl and foldr were easily and intuitively interchangeable; they're surely not so for beginners. Now I think you're arguing that given

[Haskell-cafe] examples for error handling in takusen?

2009-03-14 Thread Gü?nther Schmidt
Hi, can someone please point me to error handling examples with takusen? I try to run a piece of code with takusen but just get the very sparse Database.InternalEnumerator.DBException ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Dan Doel
On Saturday 14 March 2009 8:12:09 am Conor McBride wrote: Rome wasn't burnt in a day. Of course I want more than just numerical indexing (and I even have a plan) but numeric constraints are so useful and have so much of their own peculiar structure that they're worth studying in their own

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Colin Paul Adams
Claus == Claus Reinke claus.rei...@talk21.com writes: Claus None of which is satisfactory. You might also want to add Claus yourself to this ticket: Clausindex out of range error message regression Claus http://hackage.haskell.org/trac/ghc/ticket/2669 How do I do that? --

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Colin Paul Adams
Adrian == Adrian Neumann aneum...@inf.fu-berlin.de writes: Adrian You can use the ghci debugger http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci- Adrian debugger.html Adrian it can set breakpoints on exceptions. So i tried adding the -fbreak-on-error flag. It made

[Haskell-cafe] Uploading files to the wiki

2009-03-14 Thread Wouter Swierstra
I can't manage to upload files to the Haskell wiki. I've tried different browsers, different internet connections, different machines, different operating systems, and different user accounts - all without success. Is this a new anti-spam measure? This is slightly annoying. I was looking

Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Wolfgang Jeltsch
Am Samstag, 14. März 2009 14:51 schrieb Conor McBride: Conor, is Epigram currently under development? We've even stopped working on the engine and started working on the chassis. I'm in an intensive teaching block until the end of April, but from May it becomes Priority. The Reusability and

Re: [Haskell-cafe] Problem with cabal-install where package requires* mutually exclusive versions of another package

2009-03-14 Thread Duncan Coutts
On Sat, 2009-03-14 at 19:10 +1100, Mark Wassell wrote: I am trying install a package using cabal-install however the package requies an older version of QuickCheck and one of the required packages requires the latest version: $ cabal fetch Reactive Resolving dependencies... cabal.exe:

Re: Re[2]: [Haskell-cafe] bytestring vs. uvector

2009-03-14 Thread Duncan Coutts
On Tue, 2009-03-10 at 23:55 +0300, Bulat Ziganshin wrote: starting with 6.6, ForeignArray access is no-op, so we can just use obvious Ptr operations (via Storable class) to get unboxed arrays fast access. so, no more need for those special ByteArray# access operations but Array library

Re: Re[2]: [Haskell-cafe] bytestring vs. uvector

2009-03-14 Thread Duncan Coutts
On Fri, 2009-03-13 at 20:30 +0300, Bulat Ziganshin wrote: Hello Don, Friday, March 13, 2009, 8:08:57 PM, you wrote: What is the reason why you have decided to use unpinned arrays (ByteArray#) instead of pinned arrays (Foreign.Ptr)? They prevent heap fragmentation (and in general are

Re: [Haskell-cafe] bytestring vs. uvector

2009-03-14 Thread Duncan Coutts
On Mon, 2009-03-09 at 18:29 -0700, Alexander Dunlap wrote: Thanks for all of the responses! So let me see if my summary is accurate here: - ByteString is for just that: strings of bytes, generally read off of a disk. The Char8 version just interprets the Word8s as Chars but doesn't do

Re: [Haskell-cafe] Problem with cabal-install where package requires* mutually exclusive versions of another package

2009-03-14 Thread Denis Bueno
On Sat, Mar 14, 2009 at 09:40, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: A medium term solution here should involve letting packages specify that some of their dependencies are private, ie nothing is re-exported and thus there is no danger of clashes. Is the long term solution to

Re: [Haskell-cafe] Problem with cabal-install where package requires* mutually exclusive versions of another package

2009-03-14 Thread Duncan Coutts
On Sat, 2009-03-14 at 10:02 -0600, Denis Bueno wrote: On Sat, Mar 14, 2009 at 09:40, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: A medium term solution here should involve letting packages specify that some of their dependencies are private, ie nothing is re-exported and thus there is

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-14 Thread Manlio Perillo
Daniel Peebles ha scritto: I have added UAProd-based Binary instances to my copy of the uvector repo at http://patch-tag.com/publicrepos/pumpkin-uvector . I can confirm that it works for me. However I have now a memory problem with data decoding. I need to serialize the Netflix Prize

Re: [Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Don Stewart
grzegorz.chrupala: Hi all, Is there a serialization library other than the Data.Binary from hackage? I am using Data.Binary in a couple of projects, but I have found its stack and memory usage very hard to control. Its very common that decoding a map or list of non-trivial size uses up

Re: [Haskell-cafe] Re: Haskell-Wiki Account registration

2009-03-14 Thread Malcolm Wallace
On 14 Mar 2009, at 10:20, Ashley Yakeley wrote: We will have a more up-to-date distribution when a new machine takes over from the existing machine at Yale. I don't know when anyone will have a new machine. The contract with Yale for running the haskell.org machine is due for its yearly

Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Conor McBride
Hi Dan On 14 Mar 2009, at 14:26, Dan Doel wrote: On Saturday 14 March 2009 8:12:09 am Conor McBride wrote: Rome wasn't burnt in a day. Of course I want more than just numerical indexing (and I even have a plan) but numeric constraints are so useful and have so much of their own peculiar

Re: [Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Grzegorz Chrupala
Don Stewart-2 wrote: Have you tried the latest release, which modified the Map and [a] instances? No, I'm working with 0.5. I'll give the new version a try. Thanks! -- Grzegorz -- View this message in context: http://www.nabble.com/Alternative-to-Data.Binary-tp22512229p22514771.html

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-14 Thread Malcolm Wallace
The main issue seems to be that although the semantics of UIO may be arbitrary, Wallace's patch actually broke deserialization for any production-based UArr, and I'm not sure the benefits are worthwhile (loading a file someone else sent you) given that endianness is already not taken into account

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-14 Thread Marcin Kosiba
On Friday 13 March 2009, Cristiano Paris wrote: 2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: Hi,        I've already checked those out. I tried using your yield implementation and while it works, I couldn't get it to work with the state monad.        So while: data RecPair a b =

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-14 Thread Daniel Peebles
I'm sorry, I didn't mean to imply otherwise. I can see your point, but maybe it would be even more flexible in that kind of situation to keep a separate UIO-like API that allows one to explicitly request a particular size? For your large dataset, you could specify the entire filesize (divided by

Re: [Haskell-cafe] Hashing over equivalence classes

2009-03-14 Thread Ryan Ingram
For the second case you might be able to come up with a commutative hash-combiner function for and ||. For the lambda-term situation, I can think of a couple ways to hash that give what you want. (1) Ignore variable names altogether while hashing; this gives you what you want but has the

Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Dan Doel
On Saturday 14 March 2009 1:07:01 pm Conor McBride wrote: But this... 2) A family of singleton types int(n) parameterized by the static type. For instance, int(5) is the type that contains only the run-time value 5. 3) An existential around the above family for representing

Re: [Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Manlio Perillo
Don Stewart ha scritto: grzegorz.chrupala: Hi all, Is there a serialization library other than the Data.Binary from hackage? I am using Data.Binary in a couple of projects, but I have found its stack and memory usage very hard to control. Its very common that decoding a map or list of

[Haskell-cafe] Re: Alternative to Data.Binary

2009-03-14 Thread Achim Schneider
Grzegorz Chrupala grzegorz.chrup...@computing.dcu.ie wrote: Hi all, Is there a serialization library other than the Data.Binary from hackage? There are Iteratees[1]. They're still grok-in-process___ community-wise They are (afaik) currently only used for file input, though it's certainly

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Claus Reinke
Claus None of which is satisfactory. You might also want to add Claus yourself to this ticket: Clausindex out of range error message regression Claus http://hackage.haskell.org/trac/ghc/ticket/2669 How do I do that? Ghc Trac's idea of voting is by adding yourself to the cc, so

[Haskell-cafe] Proof of induction case of simple foldl identity.

2009-03-14 Thread R J
Can someone provide the induction-case proof of the following identity: foldl (-) ((-) x y) ys = (foldl (-) x ys) - y If foldl is defined as usual: foldl :: (b - a - b) - b - [a] - b foldl f e [] = e foldl f e (x : xs) = myFoldl f (f e x) xs The

[Haskell-cafe] building c-callable shared objects and dlls with Haskell

2009-03-14 Thread Anton Tayanovskyy
Hello, What's the current best practice to build shared objects / dlls to call Haskell from C? I think I figured out the basics, but I would like to understand the picture completely and document the current state of affairs in the Haskell wiki. In particular, I'd like to make sure that the

the nearly dependent near future, was Re: [Haskell-cafe] Microsoft PhD Scholarship at Strathclyde

2009-03-14 Thread Conor McBride
Hi Dan On 14 Mar 2009, at 18:48, Dan Doel wrote: On Saturday 14 March 2009 1:07:01 pm Conor McBride wrote: I don't think the duplicate-or-plunge dilemma you pose exhausts the options. At least, I seem no reason to presume so and I look forward to finding out! I didn't mean to suggest that

[Haskell-cafe] What's new on Hackage this week? March 14, 2009

2009-03-14 Thread Don Stewart
http://archhaskell.wordpress.com/2009/03/14/arch-haskell-news-mar-14-2009/ A regular update of Haskell in Arch Linux Arch now has 974 Haskell packages in AUR. That’s 12 new packages this week, and lots of updates as well. See the blog for the full list of updates. -- Don

Re: [Haskell-cafe] Proof of induction case of simple foldl identity.

2009-03-14 Thread Dean Herington
At 8:45 PM + 3/14/09, R J wrote: Can someone provide the induction-case proof of the following identity: foldl (-) ((-) x y) ys = (foldl (-) x ys) - y If foldl is defined as usual: foldl :: (b - a - b) - b - [a] - b foldl f e [] = e foldl f e (x :

Re: [Haskell-cafe] Proof of induction case of simple foldl identity.

2009-03-14 Thread Daniel Fischer
Am Samstag, 14. März 2009 21:45 schrieb R J: Can someone provide the induction-case proof of the following identity: foldl (-) ((-) x y) ys = (foldl (-) x ys) - y If foldl is defined as usual: foldl :: (b - a - b) - b - [a] - b foldl f e [] = e (R)

Re: [Haskell-cafe] Natural Numbers: Best implementation?

2009-03-14 Thread Henning Thielemann
On Fri, 13 Mar 2009, Mark Spezzano wrote: 1.  Don’t bother. Just use Integer. 2.  Use the type data Natural = Zero | Succ !Natural 3.  Use the following definition taken from the Gentle Introduction to Haskell 98 newtype Natural = MakeNatural Integer This option looks like non-negative

Re: [Haskell-cafe] Proof of induction case of simple foldl identity.

2009-03-14 Thread Marcin Kosiba
On Saturday 14 March 2009, Daniel Fischer wrote: Am Samstag, 14. März 2009 21:45 schrieb R J: Can someone provide the induction-case proof of the following identity: foldl (-) ((-) x y) ys = (foldl (-) x ys) - y If foldl is defined as usual: foldl :: (b - a -

[Haskell-cafe] Re: How to catch error in array index when debugging

2009-03-14 Thread Peter Hercek
Colin Paul Adams wrote: Adrian == Adrian Neumann aneum...@inf.fu-berlin.de writes: Adrian You can use the ghci debugger http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci- Adrian debugger.html Adrian it can set breakpoints on exceptions. So i tried adding the

Re: [Haskell-cafe] Proof of induction case of simple foldl identity.

2009-03-14 Thread Daniel Fischer
Am Samstag, 14. März 2009 22:44 schrieb Marcin Kosiba: (L) forall u v w. (u - v) - w = (u - v) - w Typo? :) (L) forall u v w. (u - v) - w = (u - w) - v Sure. Thanks for spotting it. I had (x-y)-z = (x-z)-y first, then decided it would be better to use different variable names...

Re: [Haskell-cafe] Style Guide for Haskell Code

2009-03-14 Thread Henning Thielemann
On Sat, 14 Mar 2009, Martijn van Steenbergen wrote: Henning Thielemann wrote: Of course, style is a matter of taste. So there are as many good styles as programmers and there won't be an official style guide, I'm afraid. While that is true, it's no valid reason to not have a style guide.

Re: [Haskell-cafe] Natural Numbers: Best implementation?

2009-03-14 Thread Henning Thielemann
On Fri, 13 Mar 2009, Wolfgang Jeltsch wrote: Am Freitag, 13. März 2009 09:21 schrieb Roman Cheplyaka: * Alexander Dunlap alexander.dun...@gmail.com [2009-03-12 20:01:57-0700] Also, a lot of functions just take Integers so it would be more of a pain to use. AFAIK there are very few

[Haskell-cafe] Re: Has anybody replicated =~ s/../../ or even something more basic for doing replacements with pcre haskell regexen?

2009-03-14 Thread Thomas Hartman
So, I tweaked Text.Regex to have the behavior I need. http://patch-tag.com/repo/haskell-learning/browse/regexStuff/pcreReplace.hs FWIW, the problem I was trying to solve was deleting single newlines but not strings of newlines in a document. Dead simple for pcre-regex with lookaround. But, I

Re: [Haskell-cafe] State monad is missing Applicative instance

2009-03-14 Thread Henning Thielemann
On Sat, 14 Mar 2009, Peter Verswyvelen wrote: I was using the transformers but still had to implement the Applicative instance of State This package contains an applicative instance for StateT but not for State In 'transformers' State is a type synonym for StateT Identity and thus does not

[Haskell-cafe] Re: Has anybody replicated =~ s/../../ or even something more basic for doing replacements with pcre haskell regexen?

2009-03-14 Thread Don Stewart
Also, consider stealing the regex susbt code from: http://shootout.alioth.debian.org/u64q/benchmark.php?test=regexdnalang=ghcid=4 tphyahoo: So, I tweaked Text.Regex to have the behavior I need. http://patch-tag.com/repo/haskell-learning/browse/regexStuff/pcreReplace.hs FWIW, the

Re: [Haskell-cafe] Re: Has anybody replicated =~ s/../../ or even something more basic for doing replacements with pcre haskell regexen?

2009-03-14 Thread Brandon S. Allbery KF8NH
On 2009 Mar 14, at 19:01, Thomas Hartman wrote: FWIW, the problem I was trying to solve was deleting single newlines but not strings of newlines in a document. Dead simple for pcre-regex with lookaround. But, I think, impossible with posix regex. s/(^|[^\n])\n($|[^\n])/\1\2/g; POSIX regexen

[Haskell-cafe] Re: Does anybody dislike implicit params as much asI do?

2009-03-14 Thread Ashley Yakeley
Sittampalam, Ganesh wrote: I think they have a useful place in propagating semi-global configuration information without imposing huge syntactic overhead. Right, for instance, type MyMonad a = (?env :: Env) = IO a No lift needed! I was hoping to use IPs to do OO-style implicit type

[Haskell-cafe] RE: Hashing over equivalence classes

2009-03-14 Thread Galchin, Vasili
Hi Roman, So are you really talking about an equivalence relation on the function's domain? The reason I ask is that it is well known that f(a)=f(b) establishes an equivalence relation on f's co-domain! Vasili ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Design Patterns by Gamma or equivalent

2009-03-14 Thread wren ng thornton
Mark Spezzano wrote: Because Haskell is not OO, it is functional, I was wondering if there is some kind of analogous “design pattern”/”template” type concept that describe commonly used functions that can be “factored out” in a general sense to provide the same kind of usefulness that Design

Re: [Haskell-cafe] Re: Alternative to Data.Binary

2009-03-14 Thread porges
2009/3/15 Achim Schneider bars...@web.de Hmmm. Output-iteratees are a very, very, interesting thing to think about. Careful, comments like that have a tendency to invoke Oleg. Next thing you know: Interesting Question -- Maybe you could... ^ |

[Haskell-cafe] I can't install hs-plugins beceause of Linker.h

2009-03-14 Thread Yuri Kashnikoff
Hi! I was trying to install hs-plugins both from sources $./Setup.lhs ... and with $cabal fetchcabal install and both failed. It always reports that Linker.h is missing. I have tried to use --extra-include-dirs with path to ghc-6.10.1 dir and ghc-6.10.1/include dir. Nothing changed. Here is a

Re: [Haskell-cafe] Design Patterns by Gamma or equivalent

2009-03-14 Thread Don Stewart
wren: There also a number of idioms which are similar in scope to the idioms that arise in other languages: using tail recursion, accumulators, continuation-passing transformations, closures over recursion[6], Schwartzian transforms, etc. [6] For lack of a better name. I mean doing

Re: [Haskell-cafe] A systematic method for deriving a defintion of foldl using foldr?

2009-03-14 Thread wren ng thornton
R J wrote: 2. I believe that the reverse implementation--namely, implementing foldr in terms of foldl--is impossible. What's the proof of that? As others have said, foldr in terms of foldl is impossible when infinite lists are taken into account. For finite lists it's easy though: (\f z