Re: [Haskell-cafe] Sinus in Haskell

2007-11-09 Thread Carl Witty
On Sat, 2007-11-10 at 01:29 +0100, Daniel Fischer wrote: > > The above essay was written after much experimentation using the MPFR > > library for correctly-rounded arbitrary-precision floating point, as > > exposed in the Sage computer algebra system. > > > >

Re: [Haskell-cafe] Sinus in Haskell

2007-11-09 Thread Carl Witty
near pi is almost exactly -1, this is approximately (pi - Prelude.pi). But that's not the answer you're getting; instead, you're getting exactly (approx_pi - Prelude.pi), where approx_pi is a 68-bit approximation to pi. Then sin(3*Prelude.pi) should be approxim

Re: [Haskell-cafe] ANN: Math.OEIS 0.1

2007-10-25 Thread Carl Witty
www.sagemath.org/hg/sage-main/rss-log/tip/sage/combinat/sloane_functions.py Carl Witty ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Type vs TypeClass duality

2007-10-23 Thread Carl Witty
n, show_list would take a hidden dictionary parameter and a normal list parameter. But on your list, show_list takes a list where each element contains a hidden dictionary.) Carl Witty ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Help parsing dates and times

2007-10-16 Thread Carl Witty
s to XML Schema; the dateTime type in XML Schema is standardized here: http://www.w3.org/TR/xmlschema-2/#dateTime (and time zone offsets are required to have a colon in this format). Carl Witty ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Frisby grammars that have context

2007-05-31 Thread Carl Witty
Grammars, and I'm pretty sure that this is supposed to not be possible. Basically, PEG parsers manage to be linar-time by caching the result of attempting to parse a particular nonterminal at a particular input position. If your nonterminal depends on previous input to dec

Re: [Haskell-cafe] Data.Generics question

2006-12-19 Thread Carl Witty
ice. If you have many compiler phases, each of which allows a slightly different set of constructors, then you may need many type parameters to your types. (Although to a certain extent this can be hidden with type aliases.) Also, you need to worry about the witnesses in all your pattern-matching code, which is annoying. Carl Witty ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] WANTED: grey line layout boxes in vim and emacs

2006-12-06 Thread Carl Witty
sal seems like it should work quite well. Somebody with a lot more spare time than me should code it up and see how much real code it breaks. Carl Witty ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] non-total operator precedence order (was:Fractional/negative fixity?)

2006-11-09 Thread Carl Witty
1 b op2 c is illegal, and the programmer must instead write (a op1 b) op2 c or a op1 (b op2 c) Carl Witty ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Fractional/negative fixity?

2006-11-06 Thread Carl Witty
nate approach of using a first pass that ignores precedences and fixing them up with a second-pass hand-written operator precedence parser seems to be easier and more popular, and should be easy to adapt to new precedence levels.) Carl Witty ___ Ha

Re: [Haskell-cafe] function result caching

2006-10-12 Thread Carl Witty
t it isn't very hard.) This generalizes to any kind of key that can be uniquely serialized into bits; looking up the corresponding value then takes O(# of bits in the key) extra time and space, which is far better than the O(2^(# of bits in the key)) that an infinite list would

Re: [Haskell-cafe] Partially-applied type synonyms?

2004-08-31 Thread Carl Witty
kell.org/pipermail/haskell-cafe/2004-March/005965.html Carl Witty ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] What are Kind errors and how do you fix them?

2004-03-26 Thread Carl Witty
ss type constructors with newtype (at the cost of having a constructor for the type); the following works: newtype MyType a = Make_MyType [a] instance MyClass MyType a where emptyVal=Make_MyType [] Carl Witty ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] looking for optimization advice

2004-03-25 Thread Carl Witty
parisons, as you suspect, then none of the measures I suggest for speeding up unsuccessful comparisons will help much. I do have more ideas along that line, though, if it turns out that unsuccessful comparisons do take up too much time.) Carl Witty __

Re: [Haskell-cafe] looking for optimization advice

2004-03-25 Thread Carl Witty
ong-running application; you could probably avoid that with weak pointers.) Carl Witty ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Path names (again?)

2004-02-05 Thread Carl Witty
-printf" at the end of each file name, and then > parse that, but it would really be preferable to code an haskell > library function equivalent to unix find. If your "find" supports it (GNU find does, I don't know about others), you can use "find -print0" to N

Re: threaded red-black tree

2003-09-14 Thread Carl Witty
he following solution :-) There is a purely functional implementation of a red-black tree in the MetaPRL system (www.metaprl.org), written in OCaml. For the latest CVS version of this red-black tree code, go to http://cvs.metaprl.org:12000/cvsweb/metaprl/libmojave/stdlib/ (look at lm_map.ml and lm_