Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-08 Thread John Meacham
On Thu, Sep 08, 2005 at 01:30:51PM -0700, Frederik Eaton wrote: > On Thu, Sep 08, 2005 at 09:30:34AM -0700, Scherrer, Chad wrote: > > One of Mark Jones's articles suggests something like > > > > class Plus a b c | a b -> c where > > (+) :: a -> b -> c > > > > Would > > > > instance (Plus a b c

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-08 Thread Frederik Eaton
On Thu, Sep 08, 2005 at 09:30:34AM -0700, Scherrer, Chad wrote: > One of Mark Jones's articles suggests something like > > class Plus a b c | a b -> c where > (+) :: a -> b -> c > > Would > > instance (Plus a b c, Monad m) => Plus (m a) (m b) (m c) where > mx + my = do x <- mx >

Re: [Haskell] mailing list headaches

2005-09-08 Thread Glynn Clements
Frederik Eaton wrote: > However, threading by "References", which RFC 2822 says > SHOULD be possible, and which works on my other folders, doesn't work > well on Haskell mailing lists. Presumably the issue is that there are > a large number of Windows users with strange mail clients which don't >

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-08 Thread Scherrer, Chad
One of Mark Jones's articles suggests something like class Plus a b c | a b -> c where (+) :: a -> b -> c Would instance (Plus a b c, Monad m) => Plus (m a) (m b) (m c) where mx + my = do x <- mx y <- my return (x + y) do what you're looking for? Chad Scherrer

[Haskell] ESOP 2006 Call for papers

2005-09-08 Thread Peter Sestoft
Call for Papers ESOP 2006: The European Symposium on Programming http://www.itu.dk/research/esop06/ Affiliated with ETAPS'06 Vienna, Austria, 25 March to 2 April 2006 CONFERENCE DESCRIPTION ESOP is an

Re: [Haskell] mailing list headaches

2005-09-08 Thread Tomasz Zielonka
On Thu, Sep 08, 2005 at 12:29:19AM -0700, Frederik Eaton wrote: > I don't expect that this hackery will be very useful to you, but I've > posted it here so you can see: > > http://ofb.net/~frederik/mailproc.tar.gz Thanks! Hopefully it will be at least an inspiration to improve my mail config :-)

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-08 Thread Frederik Eaton
On Thu, Sep 08, 2005 at 10:35:49AM +0200, Wolfgang Lux wrote: > Frederik Eaton wrote: > > >I want the type system to be able to do "automatic lifting" of monads, > >i.e., since [] is a monad, I should be able to write the following: > >and have it interpreted as "do {a<-[1,2]; b<-[3,4]; return (a+

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-08 Thread Wolfgang Lux
Frederik Eaton wrote: I want the type system to be able to do "automatic lifting" of monads, i.e., since [] is a monad, I should be able to write the following: and have it interpreted as "do {a<-[1,2]; b<-[3,4]; return (a+b)}". Are you sure that this is the interpretation you have in mind?

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-08 Thread Keean Schupke
Can't you do automatic lifting with a "Runnable" class: class Runnable x y where run :: x -> y instance Runnable (m a) (m a) where run = id instance Runnable (s -> m a) (s -> m a) where run = id instance (Monad m,Monad n,MonadT t m,Runnable (m a) (n a)) => Run

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-08 Thread Jeremy Gibbons
On Wed, 7 Sep 2005, Frederik Eaton wrote: > I want the type system to be able to do "automatic lifting" of monads, > i.e., since [] is a monad, I should be able to write the following: > > [1,2]+[3,4] > > and have it interpreted as "do {a<-[1,2]; b<-[3,4]; return (a+b)}". You might want to take a

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-08 Thread Frederik Eaton
I guess what I don't understand is what's wrong with the first alternative you mention: > One way of preventing the compiler from rearranging effects is to > thread though a dummy variable - like a "World token", ala the IO > monad - which makes the order of operations explicit as an extra > data

Re: [Haskell] mailing list headaches

2005-09-08 Thread Frederik Eaton
On Thu, Sep 08, 2005 at 08:39:29AM +0200, Tomasz Zielonka wrote: > On Wed, Sep 07, 2005 at 12:46:42PM -0700, Frederik Eaton wrote: > > Hi all, > > Hi! > > > After some weeks of squinting, I've ended up settling with the > > following partial solution in my configuration files (I use Mutt): > > >