On 8/3/07, Lewis-Sandy, Darrell [EMAIL PROTECTED] wrote:
Is there a class property of the Control.Arrow class that represents the
evaluatation of an arrow:
eval :: (Arrow a)=a b c-b-c
You could always use the ArrowEval class. Granted, it doesn't exist,
so you'd have to write it, but it
Sebastian Sylvan wrote:
Claus Reinke wrote:
mytransaction = do {
x0 - readTVar xvar0
x1 - readTVar xvar1
:
xn - readTVar xvarn
return $ foo x0 x1 .. xn
}
ah, a concrete example. but isn't that the typical use case for ap?
mytransaction = foo `liftM` r xvar0 `ap` r xvar1 ..
Hello apfelmus,
Saturday, August 4, 2007, 12:18:33 PM, you wrote:
Then, mytransaction reads
mytransaction = return foo `apT` xvar0 `apT` xvar1 `apT` ...
how about a+b*(c+d)?
--
Best regards,
Bulatmailto:[EMAIL PROTECTED]
can you give translation you mean? i don't have anything against
combinators, they just need to be easy to use, don't forcing me to
think where i should put one, as i don't think with lazy code and C
imperative code. and they shouldn't clatter the code, too. just try to
write complex expression
Hello Claus,
Saturday, August 4, 2007, 3:06:11 PM, you wrote:
can you give translation you mean? i don't have anything against
combinators, they just need to be easy to use, don't forcing me to
think where i should put one, as i don't think with lazy code and C
imperative code. and they
0^2
0
(0 :+ 0)^2
0 :+ 0
0**2
0
(0 :+ 0)**2
NaN :+ NaN
(Is this a bug?)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I am curious about the possibility of developing Haskell programs
spontaneously with proofs about their properties and have the
type checker verify the proofs for us, in a way one would do in
a dependently typed language.
In the exercise below, I tried to redo part of the merge-sort
example in
On Aug 4, 2007, at 11:19 , Bulat Ziganshin wrote:
and use it. want to assign a=b/(c+d)? nothing can be easier! just
define one more macro!
And? Everything above machine code is just macros at various
levels of abstraction, including all our favorite higher-level
abstractions.
--
Paul Johnson wrote:
Andrew Coppin wrote:
0**2
0
(0 :+ 0)**2
NaN :+ NaN
(Is this a bug?)
According to the Standard Prelude,
# x ** y = exp (log x * y)
I had a feeling this would be the cause.
log 0
-Infinity
Oh. So... since when does Haskell know about infinity?
BTW, I
Haskell doesn't know much about infinity, but Haskell implementations are
allowed to use IEEE floating point which has infinity.
And to get things right, there needs to be a few changes to the library to
do the right thing for certain numbers, this is not news. In fact I filed a
bug report a
Hello Brandon,
Saturday, August 4, 2007, 7:27:16 PM, you wrote:
On Aug 4, 2007, at 11:19 , Bulat Ziganshin wrote:
and use it. want to assign a=b/(c+d)? nothing can be easier! just
define one more macro!
And? Everything above machine code is just macros at various
levels of abstraction,
I think that defining lifted versions of every function is dangerous,
especially in a widely-used library. Monadic code will start to look
pure, and before long someone will be using let expressions and where
blocks to share monadic computations rather than using do blocks to
share the *results*
Lennart Augustsson wrote:
Haskell doesn't know much about infinity, but Haskell implementations
are allowed to use IEEE floating point which has infinity.
And to get things right, there needs to be a few changes to the
library to do the right thing for certain numbers, this is not news.
In
On Aug 4, 2007, at 11:48 , Bulat Ziganshin wrote:
Hello Brandon,
Saturday, August 4, 2007, 7:27:16 PM, you wrote:
On Aug 4, 2007, at 11:19 , Bulat Ziganshin wrote:
and use it. want to assign a=b/(c+d)? nothing can be easier! just
define one more macro!
And? Everything above machine
Shin-Cheng Mu wrote:
I am curious about the possibility of developing Haskell programs
spontaneously with proofs about their properties and have the
type checker verify the proofs for us, in a way one would do in
a dependently typed language.
In the exercise below, I tried to redo part of
Andrew Coppin wrote:
It's news to me that the IEEE floating point standard defines
infinity. (NaN I knew about...)
See http://en.wikipedia.org/wiki/IEEE_754
Paul.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Andrew Coppin wrote:
Paul Johnson wrote:
log 0
-Infinity
Oh. So... since when does Haskell know about infinity?
I should have mentioned that the underlying platform in my case is an
Intel P4. Haskell does not specify a floating point implementation; the
assumption is that it uses whatever
Also see
http://hal.archives-ouvertes.fr/hal-00128124
before you start on any serious numerical software.
Paul.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
The Haskell type class RealFloat has a reasonable number of operations to
test for NaN, denormalized numbers, etc.
You can also ask if the implementation uses IEEE.
-- Lennart
On 8/4/07, Paul Johnson [EMAIL PROTECTED] wrote:
Andrew Coppin wrote:
Paul Johnson wrote:
log 0
-Infinity
Um... why would infinity * 0 be NaN? That doesn't make sense...
Infinity times anything is Infinity. Zero times anything is zero. So
what should Infinity * zero be? There isn't one right answer. In
this case the morally correct answer is zero, but in other contexts
it might be Infinity
Hi
If you just use Catch (http://www-users.cs.york.ac.uk/~ndm/catch/):
foo x
| x 0 = ...
| x == 0 = ...
| x 0 = ...
This gives an error. Something identical to this code is in
Data.FiniteMap, and indeed, when using floats and NaN's (or just silly
Ord classes) you can cause
Hello Brandon,
Saturday, August 4, 2007, 8:44:46 PM, you wrote:
That would be why I'm using a language which lets me compose things
in complex ways. And just once, abstracting it away into a library,
which you seem to be missing.
and you hate 'do' syntax sugar?
--
Best regards,
Bulat
Andrew Coppin wrote:
0^2
0
(0 :+ 0)^2
0 :+ 0
0**2
0
(0 :+ 0)**2
NaN :+ NaN
There is nothing wrong AFAIK. (How much do I know? BSc in math, went
through classes on real analysis and complex analysis.)
There is no reason to expect complex ** to agree with real **.
Real x**y is
On 8/4/07, Albert Y. C. Lai [EMAIL PROTECTED] wrote:
There is no reason to expect complex ** to agree with real **.
There's every reason. It is standard mathematical practice to embed
the integers in the rationals in the reals in the complex numbers and
it is nice to have as many functions as
On Sat, 2007-08-04 at 23:25 +0800, Shin-Cheng Mu wrote:
[...]
In Haskell, the existential quantifier is mimicked by forall.
We define:
data DepSum a p = forall i . DepSum (a i) (p i)
The term dependent sum is borrowed from the Omega tutorial
of Sheard, Hook, and Linger [2] (why is it
On 8/4/07, Dan Piponi [EMAIL PROTECTED] wrote:
On 8/4/07, Albert Y. C. Lai [EMAIL PROTECTED] wrote:
There is no reason to expect complex ** to agree with real **.
There's every reason. It is standard mathematical practice to embed
the integers in the rationals in the reals in the complex
Another way of understanding the terminology is this:
A dependent product type (usually written \Pi x:A.B) can be thought of
as a big product of the types (B[a1/x], ..., B[aN/x]) for the
inhabitants a1...aN of the type A. To introduce a dependent product, you
have to provide each component of
On 8/4/07, Stephen Forrest [EMAIL PROTECTED] wrote:
Of course, taking the nth root is multi-valued, so if you're to return a
single value, you must choose a convention. Many implementations I have
seen choose the solution with lowest argument (i.e. the first solution
encounted by a
I noticed that there is no official FreeBSD/amd64 port yet, although
there's a binary with a working ghc but non-working ghci. Has
there been any progress on the amd64 port? Any estimate on when it
will be available? Any known workarounds (is it possible to install
and run an x86 ghc in
I can't seem to find any information on how to deal with C functions
that return a (pointer to a) struct. C2hs tells me there's no automatic
support for marshalling structs (I'm using version 0.14.5).
If I'm to do it by hand, is there a preferred way? (E.g. make the type
adhere to the type
On Aug 4, 2007, at 14:51 , Bulat Ziganshin wrote:
Hello Brandon,
Saturday, August 4, 2007, 8:44:46 PM, you wrote:
That would be why I'm using a language which lets me compose things
in complex ways. And just once, abstracting it away into a library,
which you seem to be missing.
and you
george.moschovitis:
is it possible to create a FCGI server that listens to a
specific port using the Haskell FCGI library?
The front end web server would then communicate with this
back end FCGI server through this port.
A small example would be really appreciated.
32 matches
Mail list logo