Re: [Haskell-cafe] An experimental Zipper using Thrists and first-class Labels. Help or thoughts?

2010-07-27 Thread Jason Dagit
On Mon, Jul 26, 2010 at 10:59 PM, Jason Dagit da...@codersbase.com wrote: ($) is application, but in the space of functions it is identity. So, if you think the elements in your thrist as being values in the space of functions, you're asking for a right fold that is like, v1 `id` (v2 `id`

Re: [Haskell-cafe] Re: ANN: weighted-regexp-0.1.0.0

2010-07-27 Thread Sjoerd Visscher
On Jul 27, 2010, at 7:09 AM, Sebastian Fischer wrote: I find eachOnce :: [RegExp c] - RegExp c eachOnce = foldr alt noMatch . map (foldr seq_ eps) . permutations even clearer but your version is *much* better as it uses nesting to combine all alternatives that start with

Re: [Haskell-cafe] Re: ANN: weighted-regexp-0.1.0.0

2010-07-27 Thread Sjoerd Visscher
On Jul 27, 2010, at 7:09 AM, Sebastian Fischer wrote: I'll add noMatch :: RegExp c noMatch = psym [] (const False) Oh, by the way, with noMatch, eps, alt and seq_ RegExp is itself a Semiring, but I'm not sure what that would do. -- Sjoerd Visscher http://w3future.com

Re: [Haskell-cafe] Re: ANN: weighted-regexp-0.1.0.0

2010-07-27 Thread Eugene Kirpichov
Perhaps this might mean that we can get incremental and parallel regexp matching by associating each character with a linear operator (matrix) over this or related semiring, or something, and mixing that with two sigfpe's articles:

Re: [Haskell-cafe] monoids and monads

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

[Haskell-cafe] ANN: weighted-regexp-0.1.1.0

2010-07-27 Thread Sebastian Fischer
I have released weighted-regexp-0.1.1.0 with two additional combinators: -- | Does not match anything. 'noMatch' is an identity for 'alt'. -- noMatch :: RegExp c -- | -- Matches a sequence of the given regular expressions in any -- order. For example, the regular

Re: [Haskell-cafe] Is 'flip' really necessary?

2010-07-27 Thread Yves Parès
(??) is misleading, some may be tempted to write things like: func ?? 45 ?? x , forgetting that ?? is just a mere operator, not a syntactic convenience. Unfortunately, Haskell doesn't provide Scala's underscore for partially applied functions: func(56, _, foo, _)

[Haskell-cafe] Re: ANN: weighted-regexp-0.1.0.0

2010-07-27 Thread Sebastian Fischer
On Jul 27, 2010, at 9:15 AM, Sjoerd Visscher wrote: Oh, by the way, with noMatch, eps, alt and seq_ RegExp is itself a Semiring, Yes, but it's hard to define an Eq instance for arbitrary regular expressions that reflects equivalence of regexps. There is currently only `instance Eq

[Haskell-cafe] Re: Announce snm-0.0.2: Oops

2010-07-27 Thread Johnny Morrice
Sorry if I have left typos, it's very late I knew it was a bit late to be uploading things, I forgot to say where anyone interested might download this: it's on Hackage so just cabal install snm Cheers Johnny ___ Haskell-Cafe mailing list

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

2010-07-27 Thread oleg
Lennart Augustsson wrote: Try to make Set an instance of Functor and you'll see why it isn't. It's very annoying. And yet the very simple, and old solution works. http://okmij.org/ftp/Haskell/types.html#restricted-datatypes We just properly generalize Functor, so that all old

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

2010-07-27 Thread Lennart Augustsson
But that's not really a solution, since it doesn't make a Functor instance for Set; it makes a Functor' instance for Set. If you are willing to not be upwards compatible then, yes, there are solutions. I think the best bet for an upwards compatible solutions is the associated constraints,

Re: [Haskell-cafe] monoids and monads

2010-07-27 Thread John Lato
On Tue, Jul 27, 2010 at 8:32 AM, Henning Thielemann schlepp...@henning-thielemann.de wrote: John Lato schrieb: Hello, I was wondering today, is this generally true? instance (Monad m, Monoid a) = Monoid (m a) where   mempty = return mempty   mappend = liftM2 mappend I know it isn't a

Re: [Haskell-cafe] monoids and monads

2010-07-27 Thread John Lato
On Mon, Jul 26, 2010 at 5:02 PM, Edward Kmett ekm...@gmail.com wrote: On Mon, Jul 26, 2010 at 11:55 AM, John Lato jwl...@gmail.com wrote: Hello, I was wondering today, is this generally true? instance (Monad m, Monoid a) = Monoid (m a) where  mempty = return mempty  mappend = liftM2

Re: [Haskell-cafe] Haskell Forum

2010-07-27 Thread Ketil Malde
Brandon S Allbery KF8NH allb...@ece.cmu.edu writes: Usenet *is* NNTP. In the same way the web is HTTP... (Usenet is a set of global, distributed forums using a message format similar enough to email (RFC822 + extensions) that many mail reader software supports news, and vice versa. NNTP is

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

2010-07-27 Thread Ivan Lazar Miljenovic
o...@okmij.org writes: class Functor' f a b where fmap' :: (a - b) - f a - f b I was about to ask why you mentioned b in the type signature as well, as I thought just having (Functor' f b) as a constraint in the type signature of fmap' would be sufficient, but when I went to check I found

Re: [Haskell-cafe] 1st attempt at concurrency

2010-07-27 Thread Günther Schmidt
Dear Jason, And yes, Orc is pretty cool and should be perfectly suited for what you're doing as fetching data from websites was one of the original use cases for Orc. Jason thanks for that, it's nice to be on the right track for once. Günther ___

Re: [Haskell-cafe] Actors and message-passing a la Erlang

2010-07-27 Thread Stefan Schmidt
Hi Yves, You say that With the help of this library it is possible to build Erlang-Style mailboxes, but how would you solve the issue of static typing? this wasn't an issue for me because I wanted as much type checking as possible. In many implementations, you have an implicit contract

Re: [Haskell-cafe] Haskell Forum

2010-07-27 Thread namekuseijin
On Tue, Jul 27, 2010 at 12:09 AM, aditya siram aditya.si...@gmail.com wrote: We have a Google group. Doesn't that qualify? One can't post to Haskell Cafe through the usenet/NNTP/google group interface... ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] monoids and monads

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

Re: [Haskell-cafe] Actors and message-passing a la Erlang

2010-07-27 Thread David Leimbach
On Tue, Jul 27, 2010 at 5:27 AM, Stefan Schmidt stefanschmid...@googlemail.com wrote: Hi Yves, You say that With the help of this library it is possible to build Erlang-Style mailboxes, but how would you solve the issue of static typing? this wasn't an issue for me because I wanted as

Re: [Haskell-cafe] Actors and message-passing a la Erlang

2010-07-27 Thread Joseph Wayne Norton
This may not be of direct interest to the Haskell community but I thought I'd share this information anyway. If you are looking for a solution (in Erlang that runs on Erlang's virtual machine) to enforce an explicit contract between a client and a server, there is framework called UBF.

Re: [Haskell-cafe] monoids and monads

2010-07-27 Thread Dan Doel
On Tuesday 27 July 2010 8:50:56 am Henning Thielemann wrote: I always assumed that 'm a' would be a monoid for 'm' being an applicative functor, but I never tried to prove it. Now you made me performing a proof. However the applicative functor laws from

Re: [Haskell-cafe] Is 'flip' really necessary?

2010-07-27 Thread wren ng thornton
aditya siram wrote: Eta-reducing is nice, and sometimes it makes code more readable. But 'flip' is one of those functions that always seems to hinder rather than help readability, conversely factoring out flip always makes code easier to comprehend. I don't see a need for its existence - maybe

Re: [Haskell-cafe] Re: Lists and monads

2010-07-27 Thread wren ng thornton
Kevin Jardine wrote: But as I said, that is just an example. I keep wanting to apply the usual list tools but find that they do not work inside a monad. I find myself wishing that f (m [a]) just automatically returned m f([a]) Are you looking for these? import Data.Traversable as T

Re: [Haskell-cafe] monoids and monads

2010-07-27 Thread wren ng thornton
Henning Thielemann wrote: However the applicative functor laws from http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Applicative.html are quite unintuitive and the proofs are certainly not very illustrative. I always found it more illustrative to break it down and

Re: [Haskell-cafe] An experimental Zipper using Thrists and first-class Labels. Help or thoughts?

2010-07-27 Thread Brandon Simmons
On Tue, Jul 27, 2010 at 1:59 AM, Jason Dagit da...@codersbase.com wrote: On Mon, Jul 26, 2010 at 9:00 PM, Brandon Simmons brandon.m.simm...@gmail.com wrote: I had the idea for a simple generic Zipper data structure that I thought would be possible to implement using type-threaded lists

Re: [Haskell-cafe] Haskell Forum

2010-07-27 Thread Andrew Coppin
Magnus Therning wrote: On 26/07/10 22:01, Andrew Coppin wrote: So I'm told. But it appears that some people believe that NNTP *is* Usenet, which is not the case. I use NNTP almost every single day, but I've never seen Usenet in my life... So you've only ever been on private NNTP

Re: [Haskell-cafe] Re: Haskell Forum

2010-07-27 Thread Andrew Coppin
John Meacham wrote: There already is an NNTP - mailing list gateway via gmane that gives a nice forumy and threaded web interface for those with insufficient email readers. Adding a completely different interface seems unnecessary and fragmentary. Trouble is, you can't use it like just

[Haskell-cafe] Int and ByteStrings

2010-07-27 Thread wren ng thornton
Hey all, Is there a library function (f :: [Int] - ByteString) such that it's prefix-preserving, and platform independent? GHC-only is fine for now. There are a bunch of functions of that type, but I need those guarantees and I'm hoping someone else has already done it. If there isn't one

Re: [Haskell-cafe] Re: Haskell Forum

2010-07-27 Thread Mihai Maruseac
From my experience once a forum pops up the mailing list dies. -- Mihai Maruseac ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Actors and message-passing a la Erlang

2010-07-27 Thread Yves Parès
I've found that I like Erlang's pattern matching for sorting through different kinds of data payloads, but that I prefer to use typed data channels per Limbo, Go, Plan 9's thread and messaging libraries etc. I've often wanted an Erlang with static typing to get this capability. Actually you are

[Haskell-cafe] Re: Lists and monads

2010-07-27 Thread Kevin Jardine
Looks interesting. I've also come across Data.List.Class: http://hackage.haskell.org/packages/archive/generator/0.5.1/doc/html/Data-List-Class.html Has anyone used that? Kevin On Jul 27, 6:02 pm, wren ng thornton w...@freegeek.org wrote: Kevin Jardine wrote: But as I said, that is just an

Re: [Haskell-cafe] Re: Haskell Forum

2010-07-27 Thread Darrin Chandler
On Tue, Jul 27, 2010 at 07:01:45PM +0100, Andrew Coppin wrote: If you have a forum powered by NNTP, you can casually throw in a hey, nice one time comment as a reply to part of a thread, and only people interested in that thread have to see your message (or download it, for that matter). ...

Re: [Haskell-cafe] Int and ByteStrings

2010-07-27 Thread Don Stewart
wren: Hey all, Is there a library function (f :: [Int] - ByteString) such that it's prefix-preserving, and platform independent? GHC-only is fine for now. There are a bunch of functions of that type, but I need those guarantees and I'm hoping someone else has already done it. should

Re: [Haskell-cafe] transform function for a GADT

2010-07-27 Thread Ryan Ingram
I'd add another parameter to the ExprType class and give an explicit representation to your types. data EType a where EInt :: EType Int EBool :: EType Bool data TypeEq a b where Refl :: TypeEq x x eqEType :: ExprType a - ExprType b - Maybe (TypeEq a b) eqEType EInt EInt = Just Refl

[Haskell-cafe] Parsec Best Practices examples

2010-07-27 Thread David Place
Hi, All. I have a compiler written in Parsec and Haskell for a DSL. It's quite rudimentary since I made it for my own use only. I would like to make it useable by a slightly wider circle. For this, I need better error reporting. Currently, it terminates after finding one syntax error. I

Re: [Haskell-cafe] Re: Haskell Forum

2010-07-27 Thread Andrew Coppin
Darrin Chandler wrote: IOW, if people use the proper and well known features of NNTP it would be a better world than the one we have were people do not use proper and well known features of SMTP. SMTP is designed for delivering messages point-to-point. If your email provider incorrectly

Re: [Haskell-cafe] Re: Haskell Forum

2010-07-27 Thread Nick Bowler
On 2010-07-27 19:59 +0100, Andrew Coppin wrote: Darrin Chandler wrote: IOW, if people use the proper and well known features of NNTP it would be a better world than the one we have were people do not use proper and well known features of SMTP. SMTP is designed for delivering messages

Re: [Haskell-cafe] Re: Haskell Forum

2010-07-27 Thread Darrin Chandler
On Tue, Jul 27, 2010 at 07:59:40PM +0100, Andrew Coppin wrote: NNTP is ... It's all true. I used nntp extensively in the 90s. I never emo-quit, I just stopped using it over time due to waning ISP support and other reasons made it more of a pain. I have nothing against nntp as a protocol, but I

[Haskell-cafe] Haskell at CERN

2010-07-27 Thread Alexey Khudyakov
Hello I'm wondering is there any haskellers in CERN? Given quality and usability of software there must be people looking for better alternatives. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] fine control of bytestring streaming

2010-07-27 Thread Alberto G. Corona
Hi, I´m streaming content using lazy bytestrings in a web application. The problem is that the output comes in huge blobs (presumably of 32k) one at a time. This is good for some purposes, but not for console-like interfaces or runtime log visualization. (one of my purposes is to web-alize ghci.

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

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

Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-27 Thread Peter Schmitz
Rogan: Thanks very much. I began by downloading the latest gtk+ bundle from http://www.gtk.org/download-windows.html The instructions there said to just copy the files to any dir and add its ...\gtk\bin dir to my PATH, which I did, so that worked okay without admin privs. Given that I need to

[Haskell-cafe] Error Monad and strings

2010-07-27 Thread Gerald Gutierrez
Reading the Control.Monad.Error documentation, I see that the Error class has noMsg and strMsg as its only two functions. Now, I understand that you can define your own Error instances such as in example 1 of the documentation, so why the need to always support strings via noMsg/strMsg ? What

Re: [Haskell-cafe] Error Monad and strings

2010-07-27 Thread Gregory Crosswhite
It is for the very annoying reason that in order for Error to be a monad it has to implement the fail method, which means it has to know how to turn an arbitrary string into a value of your error type. Cheers, Greg On 07/27/10 15:32, Gerald Gutierrez wrote: Reading the Control.Monad.Error

Re: [Haskell-cafe] Error Monad and strings

2010-07-27 Thread Dietrich Epp
The strMsg method is used to implement the fail method in the resulting method, and calls to fail might be inserted into your code even if you don't explicitly call it. An example in GHCi: Prelude :m + Control.Monad.Error Prelude Control.Monad.Error do { Just x - return Nothing ; return x

Re: [Haskell-cafe] Error Monad and strings

2010-07-27 Thread Gerald Gutierrez
On Tue, Jul 27, 2010 at 3:57 PM, Dietrich Epp d...@zdome.net wrote: The strMsg method is used to implement the fail method in the resulting method, and calls to fail might be inserted into your code even if you don't explicitly call it. An example in GHCi: Prelude :m + Control.Monad.Error

Re: [Haskell-cafe] Error Monad and strings

2010-07-27 Thread Dietrich Epp
I'll say yes, a pattern match failure is a bug. This is one of the great debates in the language: whether all pattern matching code should be guaranteed complete at compile time or not. However, any function you call which returns a result in your monad could theoretically call fail if

[Haskell-cafe] Re: Haskell Forum

2010-07-27 Thread Benjamin L. Russell
Kevin Jardine kevinjard...@gmail.com writes: On Jul 26, 6:45 pm, Nick Bowler nbow...@elliptictech.com wrote: Since when do mailing lists not have threading?  Web forums with proper support for threading seem to be few and far apart. Most of the email clients I'm familiar with don't support

[Haskell-cafe] Re: Haskell Forum

2010-07-27 Thread Benjamin L. Russell
Nick Bowler nbow...@elliptictech.com writes: On 13:58 Mon 26 Jul , John Meacham wrote: There already is an NNTP - mailing list gateway via gmane that gives a nice forumy and threaded web interface for those with insufficient email readers. Adding a completely different interface seems

Re: [Haskell-cafe] Error Monad and strings

2010-07-27 Thread Antoine Latter
On Tue, Jul 27, 2010 at 6:29 PM, Dietrich Epp d...@zdome.net wrote: I'll say yes, a pattern match failure is a bug.  This is one of the great debates in the language: whether all pattern matching code should be guaranteed complete at compile time or not.  However, any function you call which

Re: [Haskell-cafe] Chart package segfaults when rendering to window

2010-07-27 Thread briand
On Mon, 26 Jul 2010 21:54:16 -0700 Thomas DuBuisson thomas.dubuis...@gmail.com wrote: Can you boil this down to some simple example code? Are you using a recent version of Chart? And your definition of latest gtk2hs is 11, right? How about your gtk+ C library, it what? 2.20? I can run

[Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread michael rice
How do I import Control.Monad.State? I see this note in http://en.wikibooks.org/wiki/Haskell/Understanding_monads/State   Note: in some package systems used for GHC, the Control.Monad.State module is in a separate package, usually indicated by MTL (Monad Transformer Library). Michael

Re: [Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread Ivan Miljenovic
On 28 July 2010 12:39, michael rice nowg...@yahoo.com wrote: How do I import Control.Monad.State? Install and use the mtl library (comes with the Haskell platform), monads-fd (almost identical API to mtl; the point of this is that mtl uses some extension: the non-extension bits are in the

Re: [Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread michael rice
[mich...@localhost ~]$ ghc-pkg list mtl /usr/lib/ghc-6.12.1/package.conf.d [mich...@localhost ~]$ Installed? Michael --- On Tue, 7/27/10, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: From: Ivan Miljenovic ivan.miljeno...@gmail.com Subject: Re: [Haskell-cafe] Need Control.Monad.State To:

Re: [Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread Ivan Miljenovic
On 28 July 2010 13:03, michael rice nowg...@yahoo.com wrote: [mich...@localhost ~]$ ghc-pkg list mtl /usr/lib/ghc-6.12.1/package.conf.d [mich...@localhost ~]$ Installed? No; if it was installed it would specify a version. Michael --- On Tue, 7/27/10, Ivan Miljenovic

Re: [Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread Felipe Lessa
On Wed, Jul 28, 2010 at 12:04 AM, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: On 28 July 2010 13:03, michael rice nowg...@yahoo.com wrote: [mich...@localhost ~]$ ghc-pkg list mtl /usr/lib/ghc-6.12.1/package.conf.d [mich...@localhost ~]$ Installed? No; if it was installed it would

Re: [Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread michael rice
See below. Lot's of warnings. Is the install OK? If so, can I use the same *import*? Michael --- On Tue, 7/27/10, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: If it isn't installed, you can use cabal-install to install it: cabal install mtl -- Ivan Lazar Miljenovic

Re: [Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread Ivan Miljenovic
On 28 July 2010 13:17, michael rice nowg...@yahoo.com wrote: See below. Lot's of warnings. Is the install OK? If so, can I use the same *import*? Yeah, the install is OK. The meaning of the warnings are: * Warning: -fallow-undecidable-instances is deprecated: this GHC option has changed

Re: [Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread aditya siram
I didn't realize the State monad wasn't part of the base install. Any particular reason for this? -deech On Tue, Jul 27, 2010 at 10:24 PM, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: On 28 July 2010 13:17, michael rice nowg...@yahoo.com wrote: See below. Lot's of warnings. Is the

Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-27 Thread Rogan Creswick
On Tue, Jul 27, 2010 at 2:43 PM, Peter Schmitz ps.hask...@gmail.com wrote: So, by default, cabal wants to put its config and updates on C:. I looked at C:\Documents and Settings\pschmitz\Application Data\cabal\config It has various references to C:, some commented out. E.g.:

Re: [Haskell-cafe] Need Control.Monad.State

2010-07-27 Thread Ivan Miljenovic
On 28 July 2010 14:07, aditya siram aditya.si...@gmail.com wrote: I didn't realize the State monad wasn't part of the base install. Any particular reason for this? Because there's no reason for it to be? GHC is bundled with enough libraries as it is (and with the exception of Cabal, it's not

Re: [Haskell-cafe] Int and ByteStrings

2010-07-27 Thread wren ng thornton
Don Stewart wrote: wren: Hey all, Is there a library function (f :: [Int] - ByteString) such that it's prefix-preserving, and platform independent? GHC-only is fine for now. There are a bunch of functions of that type, but I need those guarantees and I'm hoping someone else has already