Adam,
class Foo a where
mkFoo :: a - String
instance Foo String where
mkFoo x = x
In addition to making use of language extensions or wrapper types,
you could go with the following workaround in just plain Haskell 98:
import List
class MkFoo a where
mkFoo :: a -
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bulat Ziganshin
Sent: 28 September 2006 17:29
To: Lyle Kopnicky
now i will work on edit-distance algorithm. i'm have an idea of
checking the real distance between chars - as on my keyboard, so for
example sprry can be
A few people recently asked how to pass a string between a Haskell DLL
and Excel.
I attach the proof-of-concept code that I wrote a while ago; it
demonstrates passing
a string from Excel to Haskell and the other way. Most of the C++ code
is taken
from code examples at http://msdn.microsoft.com
Andrew Pimlott wrote:
This is a follow-up to a thread from June-July[1]. The question was how to
write the function
initlast :: [a] - ([a], a)
initlast xs = (init xs, last xs)
so that it can be consumed in fixed space:
main = print $ case initlast [0..10] of
On Thu, Sep 28, 2006 at 03:22:25PM +0100, Simon Peyton-Jones wrote:
| Does anything go wrong with irrefutable patterns for existential types?
Try giving the translation into System F.
I'm a bit puzzled about this. A declaration
data Foo = forall a. MkFoo a (a - Bool)
is equivalent
Benjamin Franksen wrote:
Brian Hulley wrote:
ith = Data.Array.IArray.(!)
Sorry, but I can't see the problem here. Why can't the editor offer
the operator as '!' in the list of options, and if the user selects
it insert both '(' and ')' at the right places (i.e. before the
module name
I must be missing your point. Newtype is just type isomorphism; a new
name for an existing type. But there is not existing type exists x.
T(x). So it's not surprising that newtype doesn't support
existentials.
I've lost track of this thread. Can you re-state the question? I'm
strongly
On Fri, Sep 29, 2006 at 11:19:26AM +0100, Simon Peyton-Jones wrote:
I must be missing your point. Newtype is just type isomorphism; a new
name for an existing type. But there is not existing type exists x.
T(x). So it's not surprising that newtype doesn't support
existentials.
And yet
Ross Paterson wrote:
The story so far:
apfelmus: why are there no irrefutable patterns for GADTs?
Conor: because you could use them to write unsafeCoerce
Ross: how about irrefutable patterns (or newtypes) for existential types?
Simon: Try giving the translation into System F + (existential)
[EMAIL PROTECTED] wrote:
Ross Paterson wrote:
The story so far:
apfelmus: why are there no irrefutable patterns for GADTs?
Conor: because you could use them to write unsafeCoerce
Ross: how about irrefutable patterns (or newtypes) for existential types?
Simon: Try giving the translation into
On Sep 28, 2006, at 8:47 PM, David Curran wrote:
Sorry if this comes across as the rant it is. If you are interested in
doing useful stuff rather then navel gazing please stop here.
Where are compute languages going?
I think multi core, distributed, fault tolerant.
So you would end up with a
After some thought on your replies I have realised that I was completely wrong.
1. Software needs to be concurrent
Haskell is doing more towards this goal then any other language I know of
2. Software should be provably correct.
Haskell is doing more towards this goal then any other language I
I've finally gotten enough round tuits to learn Haskell, and now that
I've done some of the exercises from _The Haskell School of Expression_
and I finally (think I) understand what a monad is, the language is
making a lot more sense to me (although my code is not always making so
much sense to
I'm reposting this in it's own new thread since I think it involves a
general issue beyond exporting Haskell DLLs.
I am having some problems with GHCs stdout when a Haskell program is
called from a windows program.
As I noted earlier I am calling some Haskell code from C as a bridge to
snip
Call me elitist if you want, but I don't want anyone who refuses or
is unable to learn calculus to be, eg, a civil engineer. He don't
have to be an expert in real analysis, but if he don't understand the
basics, I don't want him building any bridges that I'm going to be
driving on!
Nicolas Frisby said:
{}
The fact of the matter is it's a rare case when a programmer's lack of
mathematical background threatens lives. If my GUI crashes, I'm angry
but not injured. Programmers make a living without the math background
because the vast majority of employers don't seek
Hi,
Is there a built-in constant in Haskell (or, if it is
compiler-specific, in ghc) that gives the smallest positive floating
point number x such that 1+x /= x? Some languages refer to that as
double.eps or similar. I need it for numeric algorithms.
Thanks,
Tamas
Hi,
Am Freitag, den 29.09.2006, 19:30 -0400 schrieb Tamas K Papp:
the smallest positive floating point number x such that 1+x /= x?
That would be the smallest positive number, woudn't it?
Do you mean the smalles postive number x with 1+x /= 1?
Greetings,
Joachim
--
Joachim Breitner
On Sat, Sep 30, 2006 at 12:20:16AM +, Joachim Breitner wrote:
Hi,
Am Freitag, den 29.09.2006, 19:30 -0400 schrieb Tamas K Papp:
the smallest positive floating point number x such that 1+x /= x?
That would be the smallest positive number, woudn't it?
Do you mean the smalles postive
Haskell doesn't provide such a value, but you could easily compute it
from from the values given in the RealFloat class. It tells you the
base, number of digits in mantissa, etc.
As for using such an eps in a convergence test I'd be very careful.
How do you know that your iteration
On Fri, Sep 29, 2006 at 09:26:27PM -0400, Lennart Augustsson wrote:
As for using such an eps in a convergence test I'd be very careful.
How do you know that your iteration doesn't make the value bounce
back and forth with more than eps?
Hi Lennart,
Thanks for the answer, I will try it.
On Mon, Sep 25, 2006 at 03:27:32PM +0200, Henning Thielemann wrote:
Hi Henning,
Actually, laziness allows me to formulate algorithms that look more like
the specification of the problem than the solution. E.g., I can formulate
the solution of a differential equation in terms of a power series
Tamas,
You might want to read Joachim's post more carefully - he's trying to
help you, and I think he makes a good point.
-Chad
Am Freitag, den 29.09.2006, 19:30 -0400 schrieb Tamas K Papp:
the smallest positive floating point number x such that 1+x /= x?
That would be the smallest
On Fri, Sep 29, 2006 at 06:53:35PM -0700, Chad Scherrer wrote:
Tamas,
You might want to read Joachim's post more carefully - he's trying to
help you, and I think he makes a good point.
Chad,
If his point is that there is no smallest positive number, then I
think I understand it, thanks. I
24 matches
Mail list logo