Re: [Haskell-cafe] Explaining monads

2007-08-12 Thread Ronald Guida
Stefan O'Rear wrote: On Sat, Aug 11, 2007 at 03:00:04PM -0400, Ronald Guida wrote: The question remains: What is special about Monad or ArrowApply, compared to Arrow? or What is more general about Arrow, compared to Monad or ArrowApply? If all you have is an Arrow, then you must make up

Re: Fw: [Haskell-cafe] IO within parser

2007-08-12 Thread Bulat Ziganshin
Hello Gregory, Sunday, August 12, 2007, 9:32:04 AM, you wrote: I've been struggling with writing a parser that needs to parse include files within source files.   Parsec can't accomplish with without using unsafePerformIO because it's monad is pure. it's algorithmically impossible to have any

Re: [Haskell-cafe] IO within parser

2007-08-12 Thread Malte Milatz
Gregory Propf, Sat, 11 Aug 2007 13:06:43 -0700: but the type of liftIO is baffling class Monad m = MonadIO m where liftIO :: IO a - m a But how do you define this function? There is no constructor for IO a that you can take apart. If not using unsafePerformIO, which is usually not

Re: Fw: [Haskell-cafe] IO within parser

2007-08-12 Thread Gregory Propf
I noticed that StateT can enclose IO actions for instance. So you are saying the whole Parsec library would need to be rewritten as something like a ParsecT transformer monad for this to work? If this is the case I suppose I will stick with returning my list of include files. - Greg -

Re: [Haskell-cafe] zip3, zip4 ... - zipn?

2007-08-12 Thread Tomasz Zielonka
On Sat, Aug 11, 2007 at 09:58:05AM +0200, Frank Buss wrote: Is it possible to write a function like this: zipn n list_1 list_2 list_3 ... list_n which implements zip3 for n=3, zip4 for n=4 etc.? Looks like variable number of arguments are possible, like printf shows, so a general zipn

Re: [Haskell-cafe] Explaining monads

2007-08-12 Thread Tillmann Rendel
Ronald Guida wrote: Here's a toy language, described by a regular expression: 0(10)*110 I want to read characters, one at a time, and eventually decide to Accept or Reject a string. Let me try to understand my options. * With a simple Arrow, I can create a fixed sequence of read

Re: [Haskell-cafe] varsum, was zip3, zip4 ... - zipn?

2007-08-12 Thread Conor McBride
Hi Stefan I'd have my membership of the one-leg club taken away if I didn't write in and say that,... On 12 Aug 2007, at 04:25, Stefan O'Rear wrote: On Sun, Aug 12, 2007 at 12:56:31PM +1000, Alexis Hazell wrote: On Sunday 12 August 2007 05:24, Stefan O'Rear wrote: Currying makes it MUCH

[Haskell-cafe] Re: default for quotRem in terms of divMod?

2007-08-12 Thread Henning Thielemann
On Sun, 12 Aug 2007, Lennart Augustsson wrote: CPU design cannot be changed, because they implement well defined ISA. What is ISA? Why is it not possible to add CPU functions for `div` and `mod`? The only processor I know of (NS 32k) with a different division is long dead. If efficiency on

Re: [Haskell-cafe] Re: default for quotRem in terms of divMod?

2007-08-12 Thread Isaac Dupree
Henning Thielemann wrote: On Sun, 12 Aug 2007, Lennart Augustsson wrote: CPU design cannot be changed, because they implement well defined ISA. What is ISA? Why is it not possible to add CPU functions for `div` and `mod`? Instruction set architecture - it would take a concerted industry

[Haskell-cafe] Help with a project design

2007-08-12 Thread Andrea Rossato
Hi, I'm going to be long, sorry for it. And probably also off topic, a bit at least...;-) I need a way to manage bibliographies, pretty common problem isn't it? I used to use a wiki I developed also for such a task.[1] The wiki was basically based on Bibtex. I thought I could rewrite that

Re: [Haskell-cafe] Re: towards a new foundation for set theory with atoms

2007-08-12 Thread Greg Meredith
Brandon, Cool. Well spotted. i was thinking a lot about the symmetry in the type space as a kind of group. i'll play around with your suggestion. Best wishes, --greg On 8/11/07, Brandon Michael Moore [EMAIL PROTECTED] wrote: On Fri, Aug 10, 2007 at 03:54:23PM -0700, Greg Meredith wrote:

Re: [Haskell-cafe] Explaining monads

2007-08-12 Thread Ronald Guida
Tillmann Rendel wrote: Ronald Guida wrote: Here's a toy language, described by a regular expression: 0(10)*110 I want to read characters, one at a time, and eventually decide to Accept or Reject a string. Let me try to understand my options. * With a simple Arrow, I can create a fixed

Re: [Haskell-cafe] howto install ghc-6.7.* ?

2007-08-12 Thread Ian Lynagh
On Sat, Aug 11, 2007 at 11:44:17AM +0200, Marc A. Ziegert wrote: those extralibs seem to be installed in /usr/local/lib/ghc-6.7.20070810/lib/ but registered in ghc-6.7.20070810/driver/package.conf.inplace instead of /usr/local/lib/ghc-6.7.20070810/package.conf Now fixed, thanks. By

Re: [Haskell-cafe] Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-12 Thread Brian Hulley
apfelmus wrote: Brian Hulley schrieb: main = do buffer - createBuffer edit1 - createEdit buffer edit2 - createEdit buffer splitter - createSplitter (wrapWidget edit1) (wrapWidget edit2) runMessageLoopWith splitter ... Thus the ability

Re: [Haskell-cafe] Infinity v0.1

2007-08-12 Thread Ian Lynagh
Hi Austin, On Sat, Aug 11, 2007 at 11:13:38PM -0500, Austin Seipp wrote: (there is no darcs repo yet, although I have emailed someone about a possible account for darcs.haskell.org.) http://community.haskell.org/admin/ is probably a better fit. Thanks Ian

Re: [Haskell-cafe] Explaining monads

2007-08-12 Thread Kim-Ee Yeoh
David Menendez wrote: This is probably because no one has found a compelling use case for comonadic-style programming in Haskell. There have been some interesting papers, such as Comonadic functional attribute evaluation by Uustalu and Vene, but nothing as compelling as Wadler's Monads

Re: [Haskell-cafe] Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-12 Thread Isaac Dupree
apfelmus wrote: (3+) :: Int - Int ([1,2]++):: [Int] - [Int] insert x 3 :: Map String Int - Map String Int Of course, from the purely functional point of view, this is hardly perceived as mutation since the original value is not changed at all and still available. In other

[Haskell-cafe] Suffix tree

2007-08-12 Thread Jon Harrop
Suffix trees are a data structure used to search for a substring of length m in a string of length n in O(m) time. Suffix trees can also be used for efficient approximate searches. This data structure is of particular importance in bioinformatics. Does anyone have any Haskell code

Re: [Haskell-cafe] IO within parser

2007-08-12 Thread Sam Hughes
Malte Milatz wrote: If not using unsafePerformIO, which is usually not what we want, the monad m in question must incorporate IO. That is, it could be defined something like (say we want a parser with state): newtype IOParser tok s a = IOParser (s - [tok] - IO (s,a)) You