Assuming the square had 100 pixels per side, on the average, approximately how
many random pixels should be plotted in the square before obtaining a
reasonably good estimate of pi?
Benjamin L. Russell
--- On Mon, 4/28/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> From: [EMAIL PROTECTED] <
Hello, all.
After quite a bit of collaboration with Edward Kmett over the past few days,
I've rolled up a new release of category-extras. Perhaps the most significant
addition is the generalized hylomorphism he first blogged about here:
http://comonad.com/reader/2008/generalized-hylomorphis
On Mon, 2008-04-28 at 02:54 +0200, [EMAIL PROTECTED]
wrote:
> Don Stewart writes:
>
> > Ry Dahl:
> >> By picking points randomly from a square one can calculate pi.
> ...
> >> What is the best way to express this algorithm in Haskell?
> >
> > Using a random generator, such as System.Random or
>
Don Stewart writes:
Ry Dahl:
By picking points randomly from a square one can calculate pi.
...
What is the best way to express this algorithm in Haskell?
Using a random generator, such as System.Random or
System.Random.Mersenne, generate random numbers in your range,
testing if they're ins
ry:
> By picking points randomly from a square one can calculate pi. Keep
> track of how many points from the square you pick lay in the inscribed
> circle. Supposing the square's edges are length 2, then the inscribed
> circle has radius 1. Thus the area of the circle is pi*r^2 = pi. The
> area of
By picking points randomly from a square one can calculate pi. Keep
track of how many points from the square you pick lay in the inscribed
circle. Supposing the square's edges are length 2, then the inscribed
circle has radius 1. Thus the area of the circle is pi*r^2 = pi. The
area of the square is
David F. Place wrote:
Thanks for the tip. I edited the collections.cabal file to add
"bytestring" to the Build-depends. It also needed "containers" and
"array"! The build gave streams of warnings and finally failed, so I
guess this library is not ready for use.
I don't think anyone is inte
On Sun, 2008-04-27 at 21:44 +0100, Malcolm Wallace wrote:
> >> Ian Lynagh wrote a pure haskell readline implementation a while ago,
> >
> > I think that was Malcolm Wallace.
>
> ... and it is part of the readline package! See
> System.Console.SimpleLineEditor. Needless to say, it is far from
Ian Lynagh wrote a pure haskell readline implementation a while ago,
I think that was Malcolm Wallace.
... and it is part of the readline package! See
System.Console.SimpleLineEditor. Needless to say, it is far from
perfect, but does give some basic facilities. There are lots of ways
[1]
funk f x = f (funk f) x
f :: a
x :: b
funk f x :: c
therefore funk :: a -> b -> c
RHS
f (funk f) x :: c
f (funk f) :: d -> c
x :: d
f :: e -> d -> c
funk :: h -> e
f :: h
On Apr 27, 2008, at 12:16 , David F. Place wrote:
Thanks for the tip. I edited the collections.cabal file to add
"bytestring" to the Build-depends. It also needed "containers" and
"array"! The build gave streams of warnings and finally failed, so
I guess this library is not ready for us
In case you missed it the first time here is my query again:
Hi
I know we've already looked at the topic of function type calculation
though last time I didn't have the chance to go through it
thoroughly. So here it is again. Apologies for the repetition. I've
had a try at calculating function
zefria:
> ah ha, yes. I seem to have found it here:
> http://www.haskell.org/pipermail/glasgow-haskell-bugs/2001-April/000401.html
>
> I'll use this as a base. Many thanks to the both of you. I'll be sure
> to submit it to Hackage for others to enjoy if I end up adding some
> capability to it.
ye
ah ha, yes. I seem to have found it here:
http://www.haskell.org/pipermail/glasgow-haskell-bugs/2001-April/000401.html
I'll use this as a base. Many thanks to the both of you. I'll be sure
to submit it to Hackage for others to enjoy if I end up adding some
capability to it.
___
Hello Ian,
Sunday, April 27, 2008, 11:39:03 PM, you wrote:
>> Ian Lynagh wrote a pure haskell readline implementation a while ago,
> I think that was Malcolm Wallace.
it may become even more interesting if Malcolm thinks that it was Don :))
--
Best regards,
Bulat
On Sun, Apr 27, 2008 at 12:29:34PM -0700, Donald Bruce Stewart wrote:
>
> Ian Lynagh wrote a pure haskell readline implementation a while ago,
I think that was Malcolm Wallace.
Thanks
Ian
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://
Niklas Broberg wrote:
How about
class AmqpWireC c where
amqpPutC :: AmqpWire a => c a -> ...
amqpGetC :: AmqpWire a => ... -> c a
That looks like it might work. I'll give it a go and let you know what
happens.
Thanks,
Paul.
___
Haskell-Cafe m
zefria:
> On Sun, Apr 27, 2008 at 1:02 PM, Don Stewart <[EMAIL PROTECTED]> wrote:
> > GHC supports unicode internally, and String and Char are all unicode.
> >
> > To do unicode IO however, you need to use the utf8-string package:
> >
> >http://hackage.haskell.org/cgi-bin/hackage-scripts/packag
On Sun, Apr 27, 2008 at 1:02 PM, Don Stewart <[EMAIL PROTECTED]> wrote:
> GHC supports unicode internally, and String and Char are all unicode.
>
> To do unicode IO however, you need to use the utf8-string package:
>
>http://hackage.haskell.org/cgi-bin/hackage-scripts/package/utf8-string
>
> Ju
zefria:
>In GHC there's a GHC.Unicode library, but for a string such as " *AIOO", a
>GHC compiled program prints it as a string of unknown characters, and in
>the interpreter, the string evaluates to a string of escape sequences
>instead of displaying properly.
>
>Is there a wa
In GHC there's a GHC.Unicode library, but for a string such as "ΧΑΟΣΣ", a
GHC compiled program prints it as a string of unknown characters, and in the
interpreter, the string evaluates to a string of escape sequences instead of
displaying properly.
Is there a way to get/activate unicode support in
Iavor Diatchki wrote:
Hello,
How about defining the types like this:
data PVal a = Unit a | Array [a]
data Val = IntVal (PVal Int) | BoolVal (PVal Bool) -- | etc
instance Serialize Int where ...
instance Serialize a => Serialize (PVal a) where ...
instance Serialize Val where ...
Thanks, but
consider
class FD a b | a -> b
instance CFD a b => FD a b
class CFD a b
instance CFD Bool Char
and the constraint 'CFD Bool c'.
logically, we know that if we have 'CFD Bool c', we also have 'FD Bool c',
which implies that 'c' is uniquely determined, which implies that 'c~Char'.
pr
On 4/27/08, Paul Johnson <[EMAIL PROTECTED]> wrote:
> I'm trying to write an AMQP framing layer. AMQP has two very similar union
> types: there is a "variant" that contains a single item, and an "array"
> which consists of a list of elements of the same type. So I thought I could
> define a "Unit
Thanks for the tip. I edited the collections.cabal file to add
"bytestring" to the Build-depends. It also needed "containers" and
"array"! The build gave streams of warnings and finally failed, so I
guess this library is not ready for use.
On Apr 26, 2008, at 5:30 PM, Jake Mcarthur wrot
The Haskell IDE written in Haskell (currently in early infancy) called
Leksah has now a website (with reference to a Google Code issue
tracker):
http://leksah.org/
Contributions of all kind welcome.
(The released version is still 0.11 but the development version 0.3 has
made some progress.)
Jü
Hello,
How about defining the types like this:
data PVal a = Unit a | Array [a]
data Val = IntVal (PVal Int) | BoolVal (PVal Bool) -- | etc
instance Serialize Int where ...
instance Serialize a => Serialize (PVal a) where ...
instance Serialize Val where ...
Hope this helps.
-Iavor
On Sun, Ap
On Apr 27, 2008, at 10:05 AM, Jake Mcarthur wrote:
On Apr 27, 2008, at 9:36 AM, Conal Elliott wrote:
I think we *do* want unsafeNewEmptyTMVar inlined. Here's a
convenient caching wrapper:
cached :: STM a -> TIVal a
cached m = TIVal m (unsafePerformIO newEmptyTMVarIO)
Yes, this is e
On Apr 27, 2008, at 9:36 AM, Conal Elliott wrote:
First, I think we want readTMVar instead of takeTMVar in newTIVal.
I don't see any reason it would hurt to use takeTMVar, and I suspect
the garbage collector might be slightly happier this way since it
potentially means once less reference
Looks good to me, Jake. A few comments:
First, I think we want readTMVar instead of takeTMVar in newTIVal.
I think we *do* want unsafeNewEmptyTMVar inlined. Here's a convenient
caching wrapper:
cached :: STM a -> TIVal a
cached m = TIVal m (unsafePerformIO newEmptyTMVarIO)
The instanc
I'm trying to write an AMQP framing layer. AMQP has two very similar
union types: there is a "variant" that contains a single item, and an
"array" which consists of a list of elements of the same type. So I
thought I could define a "Unit" type container thus:
> newtype Unit a = Unit {unUnit
Hi all
I was wondering if anyone has or knows of a Finite Difference or
Finite Element Implementation in pure haskell. I would like to write
this myself, but my haskell skills is not that good.
I did a bit of google search I've seen it bieng discussed, but did not
point to an actual code.
thanks
Hi,
I'm trying to implement an alarm in Haskell and wrote the following code:
http://hpaste.org/7201
But it doesn't work as expected.
The expected behaviour is: The user enters a time in minutes. If the time is
reached, a bell
rings. If, before the time is reached, he press enter, the program f
Jan-Willem Maessen wrote:
Just to clarify: divide and conquer splits one tree on the root value of
the other (possibly avoiding enforcing the balance metric until after
joining trees, though not obvious how / if that's useful)? The
definition of "divide and conquer" on trees without a fixed st
Jim Snow wrote:
I guess a pov importer wouldn't necessarily be all that difficult, or
an exporter, for that matter. (Supporting every single primitive
type, texture, and rendering feature would be a daunting challenge,
but just supporting the basics might be relatively simple.) The
problem c
35 matches
Mail list logo