Re: Fudgets

2003-06-08 Thread Ashley Yakeley
In article <[EMAIL PROTECTED]>,
 Thomas Hallgren <[EMAIL PROTECTED]> wrote:

> The fudget library was designed before Haskell switched to monadic IO, 
> and there is still no support for combining arbitrary monadic IO and 
> fudgets.

Would it be worth rewriting Fudgets to take advantage of such recent 
advances in Haskell as monadic IO?

I must confess I'm not all that familiar with Fudgets, although it 
certainly looks interesting. For what sort of problems is it currently 
the best solution?

-- 
Ashley Yakeley, Seattle WA

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Fudgets

2003-06-08 Thread Thomas Hallgren
Christian Buschmann wrote:

Hi!
Is there any easy way to display an IO String with Fudgets? 
The fudget library was designed before Haskell switched to monadic IO, 
and there is still no support for combining arbitrary monadic IO and 
fudgets. There are fudgets like stdinF that might be useful, see the 
section called InOut in the fudget library reference manual.

http://www.cs.chalmers.se/Cs/Research/Functional/Fudgets/Manual/current/small.html#InOut

--
Thomas H
"I think it would be a great idea."
(Ghandi's answer when asked what he thought of Western Civilization)
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Fudgets

2003-06-08 Thread Christian Buschmann
Hi!
Is there any easy way to display an IO String with Fudgets?
I know how to display a String:
  import Fudgets

  main :: IO ()
  main = fudlogue (shellF "Prog" showMe)
  showMe = ("Hello " `labLeftOfF` displayF) >==<
   mapF getString >==< (buttonF "ClickMe!")
  getString :: Click -> String
  getString Click = "World!"
But if I change the getString-function to:

  getString :: Click -> IO String
  getString Click = return "World!" --or any other kind of function 
which returns an IO String

I get an error message. Is there any way, without using unsafePerformIO, 
to display my IO String?

thanks
  Christian Buschmann
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: powerset

2003-06-08 Thread Graham Klyne
At 18:44 05/06/03 +0100, Liyang HU wrote:
> I'd just about figured the ShowS idea, but I've yet to get a handle on 
this
> idea of [a] 'monoid'.

Might http://www.engr.mun.ca/~theo/Misc/haskell_and_monads.htm be of any
help?
Ah, thanks.  I see:

[[
A monoid is an algebraic structure consisting of a set S and an operation * 
with the following properties ...
]]

which is a datum I was missing.  (I still don't claim to understand it all, 
but at least I get a sense of whet the term monoid means.)

#g

---
Graham Klyne
<[EMAIL PROTECTED]>
PGP: 0FAA 69FF C083 000B A2E9  A131 01B9 1C7A DBCA CB5E
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Naive question on lists of duplicates

2003-06-08 Thread Dylan Thurston
On Sat, Jun 07, 2003 at 08:24:41PM -0500, Stecher, Jack wrote:
It sounds like you're on the right track...

> > You could get a moderately more efficient implementation by keeping
> > the active list as a heap rather than a list.
> 
> I had thought about that, and took the BinomialHeap.hs file from
> Okasaki, but I must have a typo somewhere, because I was having typing
> clashes that I couldn't easily clarify.  At least, when I loaded the
> BinomialHeap.hs into Hugs, it didn't complain, but when I tried to
> create an empty heap using the heapEmpty function, Hugs screamed at me.
> I got scared and fled the scene, retreating into the safety of lists.

I don't think you should worry about this now, but the problem was
problem that heapEmpty returns something like 'Heap a', for an
undetermined type variable 'a'; you may need to specify the type of
your empty heap in order for Hugs not to complain.

Peace,
Dylan


pgp0.pgp
Description: PGP signature