Re: [Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-21 Thread Thomas Hartman
When attempting to build hsh, I get complaint that it can't satisfy dependency for mtl-any. How can I get this? Thanks! ** wget http://software.complete.org/hsh/static/download_area/1.2.0/hsh_1.2.0.tar.gz [EMAIL PROTECTED]:~/haskellInstalls/hsh$ sudo runghc Setup.lhs configure

Re: [Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-21 Thread Thomas Hartman
and I'm on... [EMAIL PROTECTED]:~/haskellInstalls$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.6 2007/3/21, Thomas Hartman [EMAIL PROTECTED]: When attempting to build hsh, I get complaint that it can't satisfy dependency for mtl-any. How can I get this? Thanks!

Re: [Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-21 Thread Thomas Hartman
Some progress, but still not solved. I built ghc6.6 from source, but apt-get / libghc6-mtl-dev now seem to be circularly dependent. I'm not such an apt expert, is there an easy way out of this using packages or do I have to keep building everything from source? * [EMAIL

Re: [Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-21 Thread Thomas Hartman
Furthermore (as the above messages suggest and locate confirms), I seem to have mtl already I took a wild guess and tried specifying this with ghc -i like sudo runghc -i/usr/lib/ghc6-mtl-dev Setup.lhs configure and sudo runghc -i/usr/lib/ Setup.lhs configure but no dice. ***

Re: [Hs-Generics] FW: [Haskell-cafe] SYB vs HList (again)

2007-03-21 Thread Jules Bean
S. Alexander Jacobson wrote: Conceptually, I think what I really want is the data structure equivalent of type inference. Just as I don't want to be forced to declare my function types, I don't want to be forced to declare my data types. The field labels I use should be enough to define

[Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread DavidA
Hi, I would like to write a function untilM, which would be to until as mapM is to map. An example use would be if I had a function dice :: State Int Int which returns random dice throws within a state monad. Then I'd like to be able to do something like untilM (\(s,p)- s=100) f (0,1)

[Haskell-cafe] Design and state...

2007-03-21 Thread Magnus Therning
Recently I've been hacking together a small Haskell module on top of ptrace(2). It's comming along nicely, but it's very low level. The signals arrive in a list: wait :: Int - IO [Signal] and processing of the signals can be done using e.g. mapM_: wait childPid = mapM_ processSignal In a

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread Jules Bean
DavidA wrote: So I figure untilM should look something like: untilM :: Monad m = (a - Bool) - (a - m a) - a - m a untilM p f x = return (if p x then x else untilM p f (f x)) The problem is that the two branches of the conditional have different types. If I try to remedy that by changing then x

[Haskell-cafe] Re: flip fix and iterate

2007-03-21 Thread Pete Kazmier
Claus Reinke [EMAIL PROTECTED] writes: I won't try to understand fix just yet, but I'm still confused by the type of fix: fix :: (a - a) - a It appears to me that it takes a function as an argument, and that function takes a single argument. So how are you passing fix an anonymous

[Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-21 Thread Max Vasin
Thomas == Thomas Hartman [EMAIL PROTECTED] writes: Thomas Furthermore (as the above messages suggest and locate confirms), I Thomas seem to have mtl already Thomas I took a wild guess and tried specifying this with ghc -i Thomas like Thomas sudo runghc -i/usr/lib/ghc6-mtl-dev Setup.lhs

Re: [Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-21 Thread Claus Reinke
[trigger garbage collection when open runs out of free file descriptors, then try again] so, instead of documenting limitations and workarounds, this issue should be fixed in GHC as well. This may help in some cases but it cannot be relied upon. Finalizers are always run in a separate thread

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread David F. Place
Interesting, but what if 'p' is also a monadic action? For instance, it might access the state of the State monad which 'f' is updating. On Mar 21, 2007, at 5:31 AM, Jules Bean wrote: ..but here 'f' is a pure function, not a monadic action. If you want f to be a monadic action then you

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread Jules Bean
David F. Place wrote: Interesting, but what if 'p' is also a monadic action? For instance, it might access the state of the State monad which 'f' is updating. Then I'd stop trying to do it as a one-liner, I suspect: let untilM p f x = do cond - p x if cond then return x else do y - f x

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread David F. Place
So, the next question is: Why isn't this already in Control.Monad? On Mar 21, 2007, at 8:27 AM, Jules Bean wrote: David F. Place wrote: Interesting, but what if 'p' is also a monadic action? For instance, it might access the state of the State monad which 'f' is updating. Then I'd stop

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread Jules Bean
David F. Place wrote: So, the next question is: Why isn't this already in Control.Monad? Some people have proposed it. Part of the reason is all the possible variations (monadic action, monadic test, monadic filter, etc etc), and it's all really very easy to write yourself. Perhaps it's

Re: [Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread David F. Place
On Mar 21, 2007, at 8:40 AM, Jules Bean wrote: Part of the reason is all the possible variations (monadic action, monadic test, monadic filter, etc etc), and it's all really very easy to write yourself. Indeed, I had just written whileM_ p a = do cond - p ; if cond then do a ; whileM_ p

[Haskell-cafe] Re: How do I do conditional tail recursion in a monad?

2007-03-21 Thread apfelmus
DavidA wrote: I would like to write a function untilM, which would be to until as mapM is to map. An example use would be if I had a function dice :: State Int Int which returns random dice throws within a state monad. Then I'd like to be able to do something like untilM (\(s,p)-

Re: [Haskell-cafe] Design and state...

2007-03-21 Thread Stefan O'Rear
On Wed, Mar 21, 2007 at 09:28:15AM +, Magnus Therning wrote: Recently I've been hacking together a small Haskell module on top of ptrace(2). It's comming along nicely, but it's very low level. The signals arrive in a list: wait :: Int - IO [Signal] Aside: Why lazy? It seems like

Re: [Haskell-cafe] Design and state...

2007-03-21 Thread Magnus Therning
On Wed, Mar 21, 2007 at 07:19:20 -0700, Stefan O'Rear wrote: On Wed, Mar 21, 2007 at 09:28:15AM +, Magnus Therning wrote: Recently I've been hacking together a small Haskell module on top of ptrace(2). It's comming along nicely, but it's very low level. The signals arrive in a list:

Re: [Haskell-cafe] There can be only one fix? Pondering Bekic's lemma

2007-03-21 Thread Nicolas Frisby
Whooops. Thanks for the correction. On 3/20/07, Levent Erkok [EMAIL PROTECTED] wrote: On 3/19/07, Nicolas Frisby [EMAIL PROTECTED] wrote: Nope, but I believe the two are equipotent. This usage of believe is one of those I think I remember reading it somewhere usages. On 3/19/07, Henning

[Haskell-cafe] Partial Evaluation

2007-03-21 Thread jim burton
I am reading Hudak's paper Modular Domain Specific Languages and Tools [1] and am confused by his use of the term `Partial Evaluation'. I understand it to mean supplying some but not all arguments to a function, e.g. (+3) but it seems to mean something else too. This is in the context of

Re: [Haskell-cafe] Partial Evaluation

2007-03-21 Thread Jeff Polakow
Hello, Partial evaluation in this context (programming languages research) usually refers to compile time optimization techniques such as statically evaluating as much of a function as possible (e.g. going into the function body and evaluating as much as possible that doesn't depend on the

Re: [Haskell-cafe] Partial Evaluation

2007-03-21 Thread Bryan O'Sullivan
jim burton wrote: I am reading Hudak's paper Modular Domain Specific Languages and Tools [1] and am confused by his use of the term `Partial Evaluation'. I understand it to mean supplying some but not all arguments to a function, e.g. (+3) but it seems to mean something else too. That's

RE: [Haskell-cafe] Partial Evaluation

2007-03-21 Thread Bernie Pope
I think you are confusing partial application and partial evaluation. Though they are conceptually related. The former is what happens when you apply a function of arity N to M arguments, where M N. In Haskell the partially applied function is suspended, pending the rest of its arguments. The

[Haskell-cafe] Is ([] - []) an arrow?

2007-03-21 Thread Chad Scherrer
In John Hughes's Programming With Arrows (http://www.cs.chalmers.se/~rjmh/afp-arrows.pdf), he discusses a stream function type newtype SF a b = SF {runSF :: [a] - [b]} and gives instance Arrow SF where He gives some examples using this, and everything seems to go just fine. But in Ross

Re: [Haskell-cafe] Is ([] - []) an arrow?

2007-03-21 Thread Jeff Polakow
Hello, In John Hughes's Programming With Arrows (http://www.cs.chalmers.se/~rjmh/afp-arrows.pdf), he discusses a stream function type newtype SF a b = SF {runSF :: [a] - [b]} and gives instance Arrow SF where He gives some examples using this, and everything seems to go just fine. I

[Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-21 Thread Benjamin Franksen
Benjamin Franksen wrote: Bertram Felgenhauer wrote: Having to rely on GC to close the fds quickly enough is another problem; can this be solved on the library side, maybe by performing GCs when running out of FDs? Claus Reinke wrote: in good old Hugs, for instance, we find in function

[Haskell-cafe] How do I do conditional tail recursion in a monad?

2007-03-21 Thread Dominic Steinitz
These sort of things come up from time to time. Why not make a proposal? http://www.haskell.org/pipermail/haskell-cafe/2006-February/014214.html Dominic. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Newbie vs. laziness

2007-03-21 Thread Udo Stenzel
Alex Queiroz wrote: I don't quite get how ($!) works. I have this function: ids - liftM (map fromSql . concat ) $! quickQuery con query [] There's a difference between an IO action and the result of said action, and similarly there's a difference between making sure an action is

[Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-21 Thread John Goerzen
On 2007-03-21, Thomas Hartman [EMAIL PROTECTED] wrote: Some progress, but still not solved. I built ghc6.6 from source, but apt-get / libghc6-mtl-dev now seem to be circularly dependent. What distribution and version are you running? ___