* Manuel M T Chakravarty [EMAIL PROTECTED] [2008-03-13 12:30:40+1100]
Indeed, a matrix library would be really nice. Before getting serious
about this, please take a very close look at how PETSc
(http://www-unix.mcs.anl.gov/petsc/) handles matrices. The
abstraction
is very important
Martin Hofmann wrote:
Thanks a lot, this helps a bit, but access to function bodies is exactly
what I need.
Then perhaps you might like the method of reconstructing bodies (of
possibly compiled) functions
http://okmij.org/ftp/Computation/Generative.html#diff-th
in the form of AST --
michael at schmong.org writes:
Hello,
My name is Michael Litchard. I'm a techie living in silicon
valley, and I want to move into tech writing. I've got the
background, now I need a portfolio. I figured the best way to go
is to attach myself to some open source
On Wed, Mar 12, 2008 at 4:45 PM, Donn Cave [EMAIL PROTECTED] wrote:
Well, the problem inherently requires a certain order of
evaluation. But if you will just handle pattern match failure
in the IO monad, then you can write a simple functional
expression of the problem instead,
let
On Wed, 12 Mar 2008, Donn Cave wrote:
On Mar 12, 2008, at 2:10 PM, Henning Thielemann wrote:
On Wed, 12 Mar 2008, Donn Cave wrote:
On Mar 12, 2008, at 12:32 PM, Brandon S. Allbery KF8NH wrote:
On Mar 12, 2008, at 14:17 , Donn Cave wrote:
Sure. It isn't a lot of code, so I subjected it
On Wed, 12 Mar 2008, Don Stewart wrote:
I am under the restriction that I need to write Haskell programs using
Double which mimic existing C/C++ programs or generated data sets, and
get the same answers. (It's silly, but take it as a given
requirement.) If the C programs are using log2, then
[EMAIL PROTECTED] wrote:
G'day all.
Adrian Hey wrote:
This might be a reasonable thing to say about *sortBy*, but not sort
as the ordering of equal elements should not be observable (for any
correct instance of Ord). It should be impossible to implement a
function which can discriminate
I am also interested in helping out in this manner,
particularly with HaskellWiki.
I work as a patent translator in Tokyo, and my
specialty is technical translation. In particular, I
could help write English-language documentation on
Haskell and also translate such documentation into
Japanese
Hello all!
Up until yesterday I thought I understood the basics of Template Haskell, but
now I'm a little confused. Consider the following code
module A
where
a1 = [| (2::Int) + 2 |]
a2 = let x = (2::Int) + 2 in [| x |]
a3 = [| y |]
where
y = (2::Int) + 2
z
On Thu, Mar 13, 2008 at 1:00 AM, Adrian Hey [EMAIL PROTECTED] wrote:
AFAICT the report is ambiguous about this, or at least the non-intutive
equality semantics are not at all clear to me from what I can see in
the Eq class definition (para 6.3.1). I think an the absence of any
clear and
Hi Emil,
Your problem is related to how are things evaluated not when. The
short answer is: if you want to make sure an expression is evaluated
before you lift it, don't use quasiquotes, call
Language.Haskell.TH.lift
On Thu, Mar 13, 2008 at 9:00 AM, Emil Axelsson [EMAIL PROTECTED] wrote:
As Stefan says, System Fw is strongly normalising. This is a remarkable result
because (as you observe) it's very non-obvious how to prove it.
However GHC goes beyond Fw by adding
data types
letrec
This blows strong normalisation out of the water. (Assuming you have
reasonable
On Thu, Mar 13, 2008 at 3:02 AM, Adrian Hey [EMAIL PROTECTED] wrote:
The report doesn't state that for all Ints, (x==y = True) implies that
x=y. There's no reason to suppose the Int instance is in any way
special, so do you really seriously consider the possibility that
this might not hold
Hello All,
I'm top posting because I'm getting bored and frustrated with this
thread and I don't want to respond detail to everything Aaron has said
below.
Aaron: Where are you getting this equivalence stuff from?
Searching the report for the word equivalence the only remotely
relevant section
Jacob Schwartz [EMAIL PROTECTED] writes:
A test on IEEE computers (x86 and x86-64), shows that for
a range of 64-bit double values, the answers in C do differ (in the
last bit) if you use log2(x) and log10(x) versus log (x) /
log(2) and log(x) / log(10).
I think this may also depend on C
Luke Palmer wrote:
On Thu, Mar 13, 2008 at 1:00 AM, Adrian Hey [EMAIL PROTECTED] wrote:
AFAICT the report is ambiguous about this, or at least the non-intutive
equality semantics are not at all clear to me from what I can see in
the Eq class definition (para 6.3.1). I think an the absence of
andrea wrote:
data Tipo = Var Int | Const String | Tipo :- Tipo deriving (Show, Eq)
But now how can I do to make the set of Const fixed??
I want just a few base types, like int and string, how could I
define it?
your base types could be:
Const String :: Tipo
Const Int :: Tipo
and the
On Wed, Mar 12, 2008 at 10:03 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
Don Stewart wrote:
Hey Andrew,
What are you trying to do? Read and write to the same file (if so, you
need to use strict IO), or are you trying something sneakier?
I have a long-running Haskell program that
On Wed, 2008-03-12 at 15:59 -0400, Jeff Polakow wrote:
Data.Generics allows you to do this (to a certain extent), i.e.
there is a function
dataTypeConstrs :: DataType - [Constr]
It might be hard, or even impossible, to get Data.Typeable and
Data.Generics to play with each
Luke Palmer wrote:
On Thu, Mar 13, 2008 at 3:02 AM, Adrian Hey [EMAIL PROTECTED] wrote:
The report doesn't state that for all Ints, (x==y = True) implies that
x=y. There's no reason to suppose the Int instance is in any way
special, so do you really seriously consider the possibility that
Aha, I guess I thought for a while that [|x|] and lift x where the same thing.
Having thought too much about partial evaluation lately, I forgot that the main
purpose of quoting is to get the unevaluated AST.
I'll just use lift in the future then (for partial evalutation).
Thanks, Alfonso!
On 2008-03-13, Adrian Hey [EMAIL PROTECTED] wrote:
But the trouble is the report says practically *nothing* about Eq
class or what the (==) operator means. It all seems to be assumed,
and even when it does talk about it informally it talks about
equality, not equivalence or some other word.
Jacob Schwartz [EMAIL PROTECTED] schrieb:
I have two questions about using the Double data type and the
operations in the Floating typeclass on a computer that uses IEEE
floating point numbers.
I notice that the Floating class only provides log (presumably log
base 'e') and logBase (which,
Aaron Denney wrote:
so do you really seriously consider the possibility that
this might not hold in your Int related code?
if (x==y) then f x else g x y
might not mean the same as..
if (x==y) then f y else g x y
In Int code, of course not, because I know the types, and I know the
behaviour
I'm reading the following rule from your answer:
[|exp|] normally returns the unevaluated AST of exp. However, if exp contains
local variables, these are lifted using Language.Haskell.TH.lift (i.e. evaluated
before lifting).
Is that correct?
/ Emil
On 2008-03-13 09:49, Alfonso Acosta
On 2008-03-13, Adrian Hey [EMAIL PROTECTED] wrote:
Hello All,
I'm top posting because I'm getting bored and frustrated with this
thread and I don't want to respond detail to everything Aaron has said
below.
Aaron: Where are you getting this equivalence stuff from?
Not from the prose in the
On 2008-03-13, Adrian Hey [EMAIL PROTECTED] wrote:
Aaron Denney wrote:
so do you really seriously consider the possibility that
this might not hold in your Int related code?
if (x==y) then f x else g x y
might not mean the same as..
if (x==y) then f y else g x y
In Int code, of course
Aaron Denney [EMAIL PROTECTED] writes:
Well, the way the report specifies that max's default definition
is. I'd actually favor making that not an instance function at
all, and instead have max and min be external functions.
If you permit a naïve question:
Prelude :i Ord
class (Eq a) = Ord a
On Tue, 2008-03-11 at 18:46 -0400, [EMAIL PROTECTED] wrote:
Hello,
My name is Michael Litchard. I'm a techie living in silicon
valley, and I want to move into tech writing. I've got the
background, now I need a portfolio. I figured the best way to go
is to attach
Adrian Hey wrote:
2 - It does matter, and the result is guaranteed to be the
last maximum in all cases because:
(x==y) = True implies max x y = y
This seems to be the case looking into GHC/Base.lhs
max x y = if x = y then y else x
Christian
On 2008-03-13, Ketil Malde [EMAIL PROTECTED] wrote:
Aaron Denney [EMAIL PROTECTED] writes:
Well, the way the report specifies that max's default definition
is. I'd actually favor making that not an instance function at
all, and instead have max and min be external functions.
If you permit
Wow, you have a tough mission if you want to replicate the bit level answers
for double (btw, hi Jacob).
Libraries differ for transcendental function, and even worse, CPUs differ.
You may get different answers on an Intel and and AMD.
That said, I think your best bet is to import log2 and log10
On Mar 12, 2008, at 8:35 PM, Jacob Schwartz wrote:
My second question is how to get at the IEEE bit representation for a
Double.
My (rhetorical) question on this front isn't how do I get the
representation, but why is it so hard and non-portable to get the
representation sensibly? A
I don't think writing (1,) is an option for Haskell, it looks like a section
(and should be one).
On Wed, Mar 12, 2008 at 9:13 PM, Bryan O'Sullivan [EMAIL PROTECTED]
wrote:
Lennart Augustsson wrote:
Yes, I wish Haskell had a 1-tuple. The obvious syntax is already taken,
but I could accept
Hello Andrew,
Wednesday, March 12, 2008, 10:06:44 PM, you wrote:
When I write to a file using System.IO, the file is locked for exclusive
access. I gather this is as specified in the Haskell Report. Which is
nice, but... I'd actually prefer the file to *not* be locked. Anybody
know how to
Submited: http://hackage.haskell.org/trac/ghc/ticket/2151#preview
hugo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Thu, 13 Mar 2008, Lennart Augustsson wrote:
Wow, you have a tough mission if you want to replicate the bit level answers
for double (btw, hi Jacob).
Libraries differ for transcendental function, and even worse, CPUs differ.
You may get different answers on an Intel and and AMD.
That
Hi, I have a problem when I am trying to use a binary file generated by ghc
make in Windows.
Ihave writed an application that parses xml files and returns a result(using
HaXml), this is published as a service, I implemented a server(withSocketsDo),
the server listen the port 5760 in a
On Thu, Mar 13, 2008 at 11:13 AM, Emil Axelsson [EMAIL PROTECTED] wrote:
I'm reading the following rule from your answer:
[|exp|] normally returns the unevaluated AST of exp. However, if exp contains
local variables, these are lifted using Language.Haskell.TH.lift (i.e.
evaluated
before
On Thu, Mar 13, 2008 at 1:35 AM, Jacob Schwartz [EMAIL PROTECTED] wrote:
I have two questions about using the Double data type and the
operations in the Floating typeclass on a computer that uses IEEE
floating point numbers.
I notice that the Floating class only provides log (presumably
On Mar 13, 2008, at 5:12 , Ketil Malde wrote:
Perhaps now everybody uses SSE to do math, but earlier Intel FPU
architectures did floating point with 80-bit registers, so the
accuracy of the result could depend on whether an intermediate result
was flushed to memory (by a context switch).
Krzysztof Kościuszkiewicz wrote:
I have tried both Poly.StateLazy and Poly.State and they work quite well
- at least the space leak is eliminated. Now evaluation of the parser
state blows the stack...
The code is at http://hpaste.org/6310
Apparently, stUpdate is too lazy. I'd define
On Mar 12, 2008, at 11:23 PM, Luke Palmer wrote:
The issue is that exception handling semantics do induce an order of
evaluation for determinacy: if both functions in a composition throw
an exception at some point (say in the 3rd element of a list they're
generating), you need to decide which
Bulat Ziganshin wrote:
Hello Andrew,
one (and only?) possible way is to use Streams library which happens
to not lock files:
Is that likely to compile on Windows?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Am Mittwoch, 12. März 2008 00:53 schrieb askyle:
[…]
So if floating point (==) doesn't correspond with numeric equality, it's
not FP's fault, but ours for expecting it to do!
No, I think, it’s the Prelude’s fault to define (==) as “floating point
equality”. We should us a different
2008/3/13 Maverick [EMAIL PROTECTED]:
I have writed an application that parses xml files and returns a result
(using HaXml), this is published as a service, I implemented a server
(withSocketsDo), the server listen the port 5760 in a forever fashion, when
a message arrives, then the program
Not to be picky, but where did you hear that (==) established an
equivalence relation? Not I expect from the Haskell98 Report!
The only law I can find there is that
x /= y iff not (x == y)
So, the definition x == y = False
x /= y = True
would be perfectly legitimate,
Luke Palmer wrote:
On Wed, Mar 12, 2008 at 4:45 PM, Donn Cave [EMAIL PROTECTED] wrote:
Well, the problem inherently requires a certain order of
evaluation. But if you will just handle pattern match failure
in the IO monad, then you can write a simple functional
expression of the problem
I was lucky enough to attend a lecture by SPJ yesterday.
You're lucky that I taped it and have put it all online :-)
http://www.foomongers.org.uk/videos/spj-typedriventestinginhaskell.html
If you're a redditer please vote it up on programming.reddit!
Hi folks
I'm late into this thread, so apologies if
I'm being dim.
On 13 Mar 2008, at 16:17, [EMAIL PROTECTED] wrote:
Adrian Hey [EMAIL PROTECTED] wrote:
I would ask for any correct Eq instance something like the law:
(x==y) = True implies x=y (and vice-versa)
I wish I knew what =
On Wed, Mar 12, 2008 at 4:29 PM, Aaron Denney [EMAIL PROTECTED] wrote:
When defining max, yes, you must take care to make sure it useable for
cases when Eq is an equivalence relation, rather than equality.
If you're writing library code, then it won't generally know whether
Eq means true
G'day all.
Quoting Adrian Hey [EMAIL PROTECTED]:
I take it you mean something like ..
Err... yes, I did.
Where's the Eq instance for OrdWrap?
Omitted for brevity.
This may or may not satisfy
the law: (compare a b) = EQ implies (a == b) = True. I think
everbody agrees about that, but I
On Thu, Mar 13, 2008 at 05:52:05PM +0100, Bertram Felgenhauer wrote:
... Now evaluation of the parser state blows the stack...
The code is at http://hpaste.org/6310
Apparently, stUpdate is too lazy. I'd define
stUpdate' :: (s - s) - Parser s t ()
stUpdate' f = stUpdate f
Hi
On 13 Mar 2008, at 22:28, [EMAIL PROTECTED] wrote:
G'day all.
Quoting Adrian Hey [EMAIL PROTECTED]:
What's disputed is whether or not this law should hold:
(a == b) = True implies a = b
Apart from possibly your good self, I don't think this is disputed.
Quotient types, as noted
[EMAIL PROTECTED] wrote:
What's disputed is whether or not this law should hold:
(a == b) = True implies a = b
Apart from possibly your good self, I don't think this is disputed.
If that's supposed it imply you think I'm in a minority of one I
don't think you've been following this thread
On 2008-03-13, Conor McBride [EMAIL PROTECTED] wrote:
Hi
On 13 Mar 2008, at 22:28, [EMAIL PROTECTED] wrote:
G'day all.
Quoting Adrian Hey [EMAIL PROTECTED]:
What's disputed is whether or not this law should hold:
(a == b) = True implies a = b
Apart from possibly your good self, I don't
On 2008-03-13, David Menendez [EMAIL PROTECTED] wrote:
On Wed, Mar 12, 2008 at 4:29 PM, Aaron Denney [EMAIL PROTECTED] wrote:
When defining max, yes, you must take care to make sure it useable for
cases when Eq is an equivalence relation, rather than equality.
If you're writing library
On Wed, Mar 12, 2008 at 12:34:38PM -0700, Justin Bailey wrote:
The stack blows up when a bunch of unevaluated thunks build up, and
you try to evaluate them. One way to determine where those thunks are
getting built is to use GHCs retainer profiling. Retainer sets will
show you the call stack
G'day all.
Quoting Conor McBride [EMAIL PROTECTED]:
How depressing!
Sorry, I don't understand that. Quotient types are good, but they're
not the whole story. They just happen to be one use case with a
solid history behind them.
it's just that
we need to manage information hiding
Hi
On 13 Mar 2008, at 23:33, Aaron Denney wrote:
On 2008-03-13, Conor McBride [EMAIL PROTECTED] wrote:
Hi
On 13 Mar 2008, at 22:28, [EMAIL PROTECTED] wrote:
G'day all.
Quoting Adrian Hey [EMAIL PROTECTED]:
What's disputed is whether or not this law should hold:
(a == b) = True implies a
G'day all.
Quoting Adrian Hey [EMAIL PROTECTED]:
If that's supposed it imply you think I'm in a minority of one I
don't think you've been following this thread very well.
Sorry, that was a bit of hyperbole.
Even the report uses the word equality in the prose.
Indeed, and the only
Hi
On 13 Mar 2008, at 23:42, [EMAIL PROTECTED] wrote:
Conor McBride [EMAIL PROTECTED] responded to my comment:
(mapMonotonic should of course be removed, too,
or specified to fail (preferably in some MonadZero)
if the precondition is violated,
which should still be implementable in linear
On Thursday 13 March 2008 07:33:12 pm Aaron Denney wrote:
[snip]
I've seen mention of difficulties with Data.Map, and edison, but not
in enough detail to really grasp what the problems are. Until I do, my
natural bias (which I'm trying to resist, really) is that it's a matter
of lazy coding,
Hello,
I'm learning Haskell, so I was attempting memoization based upon the
Fibonacci examples but for the Ackermann function. In my tests, I found
what seems to be truncated output. See my comments at the end of the code
for the test cases and output.
### Begin Code ###
module Main where
Adrian Hey wrote:
I would ask for any correct Eq instance something like the law:
(x==y) = True implies x=y (and vice-versa)
which implies f x = f y for all definable f
which implies (f x == f y) = True (for expression types which are
instances of Eq). This pretty much requires structural
This answer may be way off base, but if differences appear between
ghci and compiled versions, I've often found its as simple as
remembering to compile with the -threaded flag. The ghci runtime is
threaded by default, as I understand it, while compiled binaries are
not, and IO operations
On Mar 13, 2008, at 23:47 , Donnie Jones wrote:
It seems if I don't choose an upper bound pair for (m,n) that is
large enough I get truncated output for the answer, instead of GHC
giving me an array index exception... This behavior seems very odd
to me, can someone explain? Or is this a
All,
Here http://biosimilarity.blogspot.com/2008/03/naming-as-dialectic.html is
a deliberately provocative posting (with running code and a shameless plug
for BNFC) on the process of introducing naming and name management into the
design of data structures. Comments greatly appreciated.
Best
68 matches
Mail list logo