to be a significant problem.
cheers,
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
Haskell.
cheers,
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
, and as a consequence you end up doing your thinking
sooner rather than later. This usually ends with better software with
fewer bugs.
cheers,
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
heard a Prolog guy -
Bart Demoen - talk about doing pretty much this during GC to improve
sharing.
cheers,
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe
synonyms for this
reason, but you end up polluting the global namespace.
+1 vote.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe
type BST = Tree key val
data RelaxedTree key val
= Leaf Bal [(key,val)]
| Node Bal [(key,RelaxedTree key val)]
where
data Bal = Balanced | Unbalanced
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
9899:1999 which defines fmod. It
specifies that the result of fmod(x,y) should have the same sign as x.
Interesting.
cheers,
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
is efficient (which it
probably isn't), you can implement fmod really quite efficiently.
In particular, x `fmod` 1.0 == (snd . properFraction) x
cheers,
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
(at least in Forte 5, and probably most
implementations) template instantiations are hash-consed.
I would *much* rather have a simpler type system, than a compiler
which might not terminate.
cheers,
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little
know what I mean, go and read Why
Functional Programming Matters.
Hey, that was fun. I have barely written *any* Prolog since I finished
my thesis. :-)
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
in a good word for Mercury which I worked on,
along with a few other denizens in this forum. See
www.mercury.cs.mu.oz.au.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
:
1. Order of side-effects.
2. Efficiency of implementation.
and arguably
3. Hysterical Raisins.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing
On 8/21/07, Ben [EMAIL PROTECTED] wrote:
for sake of argument, suppose an enterprising haskell newbie wanted to
code up concurrent b-trees (really b-link trees) in haskell. if i am
understanding STM correctly, it will NOT help in any way with the
implementation, because of the IO-intensive
of the memory management issues. When they don't, one
can usually make a analogous class to manage the lifetime for you.
cheers,
Tom
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
or more for more
usual 'f's. Some tasks, like Monte Carlo integration are very amenable
to such, but most tasks are not.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
of execution. As nomenclature, it is not
universal, but is very common, and helps avoid conflating two quite
different things.
cheers,
Tom
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
On 8/2/07, Daniel McAllansmith [EMAIL PROTECTED] wrote:
On Wednesday 01 August 2007 17:44, Thomas Conway wrote:
This sounds like a common problem type. Is there a well known solution
to this sort of problem?
Have you looked into Tying the Knot?
http://www.haskell.org/haskellwiki
can be made to go away. Well, not all of them -
after all Double has limited digits of mantissa, but down to quite
small scales, the arithmetic will be precise. Actually, you could use
(Either Rational Rational), except that performance would be [even
more] atrocious.
cheers,
T.
--
Dr Thomas
about the types.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
my question to the learned
members of this forum is: Am I on the right track? Is a scheme like
this going to work?
cheers,
Tom
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
recently introduced me to the Maybe
monad transformer for exactly this reason). It's actually a pretty
effective rule of thumb.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
the way C++
is taught at the undergraduate level, and the way it is perceived by
the inexperienced is that it isn't so hard.
But then again, I've taught Java at the ugrad level, and what do I
know about Java, other that it'd be quite a nice place to have a
holiday some time :)
T.
--
Dr Thomas
. From what I know of the marketplace,
people working in C# are more likely to be doing client/integration
work where technical finesse is less important, and are therefore less
likely to see the point.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were
never get the payoff. And before
you all flame, yes, I do know C++ at an expert level, and that is
exactly why, after 7 years of writing server software in C++, I now
want to do it in Haskell.
cheers,
T
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were
, and can use the Error monad, and mean it.
Level 3 - Can use monad transformers deliberately
...
Level 42 - Has realized monad really is some kind of swear word. :-)
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
when e $ writeTVar' p Empty
return (v,e)
Is this correct? And if so, is GHC likely to do constant folding on
msum over the list skeleton?
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
is used in an inner loop, so a structure giving O(1)
operations was desirable.
Anyway, the point of the original post was to find tricks for avoiding
indentation creep, rather than the trie itself.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were
, or is
there Haskellmagic that I still need to learn?
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org
of which are symbol based (0, 1 or
higher order), and others which are word based.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
is Any Expression requiring more than 80 columns is fiddly.
:-)
I say this in jest, but it is ha ha, only serious.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
Southpaw Conway
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
, but is not exported -}
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo
(-hb) aborts on my program. :-( Still,
-hc and -hd seem to work, the only hassle is the hours of running time
required to get things to go bad.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
On 7/9/07, Ketil Malde [EMAIL PROTECTED] wrote:
The current deliverables seem to consist of a tar file and a package
description, neither of them accurately dated.
Clearly we need to store them in a treap. :-)
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I
Hi All,
I notice that Data.ByteString has span and spanEnd. Is there a known
particular reason why dropWhile and takeWhile don't have corresponding
*End functions? If not, what is the protocol for adding them?
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald
more sophisticated
mechanisms, which in time will probably lead to more expressive
paradigms.
cheers,
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing
running so performance and memory usage are pretty important, and
these are relatively hard to get right in Haskell. OTOH, you can tell,
I think it's a good trade off - I did convince the mgt to let me doit
in Haskell in the first place. :-)
--
Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest
that Haskell lacks the *coverage* that Perl or
Python have.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http
FWIW,
I implemented the STM based solution, and it works a treat. It's less
of a hack than the version where I got the child thread to send a
SIGINT. ;-)
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
sure
the live op count gets decremented.
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org
somehow.
Well, it works because the sub-thread dies when the program exits, so
the socket gets closed then.
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe
.
That's the kind of [de]serialization I like. :-) Mind you, I still
have to use HaXml when I first read documents into the system, and a
very nice job it does too.
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
structure, stick it in the cache, then rerun
the transaction. There are a few details you have to get right,
including making sure none of the items you require to complete the
operation get evicted by another thread, but it works very nicely.
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence
completed. This is the case regardless of whether the
call is inside a block or not.
/quote
So no joy there.
Ideas anyone?
And is exitWith broken, or is it the doco that's broken?
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy
94.5% (84.5% elapsed)
Alloc rate506,470,897 bytes per MUT second
Productivity 5.5% of total user, 4.6% of total elapsed
Can anyone offer general suggestions for how to fix this!
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy
length would
evaluate the whole list skeleton.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http
-knife myself, comparison to sliced
bread may be faint praise. It isn't.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
name, c, c.
FWIW, the other little combinator I invariably use is
p `returning` x = p = (\_ - return x)
which I end up calling with () as the second argument so often
(especially during development), I usually have another combinator
void p = p return ()
YMMV,
T.
--
Dr Thomas Conway
[EMAIL
)
but I need to keep a firm lid on the resource usage, so I can't. sigh
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell
Key ([IO (Maybe Key)]).
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo
to the C++ STL std::pair
template type? I must be missing something.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http
On 6/19/07, apfelmus [EMAIL PROTECTED] wrote:
[nice exposition of how you could do lazy look-ma-no-updates tries]
Clearly, I still think too much like a logic programmer. :-)
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I
programming
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
that advantage vs. tries.
edna-e-mode-voice
No Strings, darling! No Strings.
/edna-e-mode-voice
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell
://citeseer.ist.psu.edu/2986.html
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo
functional programming. I'm not
sure if the thesis itself is online.
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing list
Haskell-Cafe
the intermediate Triple structures. So, how do you
convince ghc to do this? Alternatively, how would you *translate*
rather than transliterate, the mix function?
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
FWIW, here's a link to the original c code:
http://www.burtleburtle.net/bob/hash/evahash.html
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
___
Haskell-Cafe mailing
are explicit, and
not just a notational convenience as they are in lambda calculus:
main :-
f(42,X), f(42,Y),
cheers,
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much
':
x' - force x
update precomputed-table[x']
Even if you leave out property 2 and include bounds checks, this seems
like an important kind of function to optimize well. So what have I
missed, or is it time to learn how to hack on ghc?
T.
--
Thomas Conway
[EMAIL PROTECTED]
Silence
performance model (e.g. when should you use tail
recursion, and when should you not). But I happily acknowledge that my
experience is probably atypical. ;-)
cheers,
T.
--
Dr Thomas Conway You are beautiful; but learn to work,
[EMAIL PROTECTED] for you cannot eat your beauty
Appel's code generator that used dynamic programming to select
between different generated code sequences comes to mind as potential
inspiration for a super-duper inliner.
cheers,
Tom
--
Dr Thomas Conway You are beautiful; but learn to work,
[EMAIL PROTECTED] for you cannot eat your
the library
is implemented.
sigh Why are tricky problems tricky? I thought Haskell was supposed
to make everything easy. ;-)
T.
--
Dr Thomas Conway You are beautiful; but learn to work,
[EMAIL PROTECTED] for you cannot eat your beauty.
-- Congo
level.
cheers,
T.
--
Dr Thomas Conway You are beautiful; but learn to work,
[EMAIL PROTECTED] for you cannot eat your beauty.
-- Congo proverb
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On 3/7/07, mm [EMAIL PROTECTED] wrote:
f . g . h $ x
Alternativly,
(f . g . h) x
will work, too.
It always irks me that you don't actually save any horizontal space
using $. That is,
(e) x
has the same number of characters (incl spaces) as
e $ x
T.
--
Dr Thomas Conway You
. I assume it actually works, but should it?
T.
--
Dr Thomas Conway You are beautiful; but learn to work,
[EMAIL PROTECTED] for you cannot eat your beauty.
-- Congo proverb
___
Haskell-Cafe mailing
couldn't see anything in the manual to show me how.
Anyone?
--
Dr Thomas Conway You are beautiful; but learn to work,
[EMAIL PROTECTED] for you cannot eat your beauty.
-- Congo proverb
___
Haskell
Hi All,
I'm hacking some (external) B-Tree code, and amongst the numerous
interesting problems I've come up against[*], is to do with managing
which pages/nodes are in memory and which are not.
We use TVars to point from one (in-memory version of a) page to
another, so we have a type like the
So I just coded up the approach. It compiles, so I assume it works as
intended. ;-)
Comments and clever obervations extremely welcome.
cheers,
T.
module W where
import Control.Concurrent.STM
import qualified Data.Map as M
import System.Mem.Weak
import GHC.Conc
makePtr tabPtr a
= do
Hi All
I'm having some difficulty with typeclasses.
What I'm trying to do should be obvious, but it's still giving me
trouble. I want to take a packaged item, and strengthen the
constraints on its type. Rather than being just any type that is an
instance of A, I want to do a runtime check and
On 10/9/06, I wrote:
So, can anyone suggest how I can achieve my goal?
And how many milliolegs of type hackery will it take? ;-)
Tom
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Thanks Misha Matthias.
I now get what's going on. The mention of the word dictionary
revealed it all. I've spent the last 7 years programming in C++, and
had dynamic_cast firmly fixed in my head. I totally forgot that
Fergus Henderson and I independently reinvented dictionary passing for
the
Mostly hysterical raisins, I think.
T.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi All,
Next monad query [*]
In the 1995 paper Composing Haggis, layout is done using a monad to
compose individual elements. To modernize the syntax consider (forgive
the operator, but it avoids parentheses):
infixl 1 |
f | x = f x
mylayout
= do
hbox | do
button ok
Hi All,
I've been [trying to] grapple with the various monads and
transformers, and it occurs to me that the standard instance for
Either as a monadic type is unnecessarily restrictive. Is there a
compelling reason that it is not just
instance Monad (Either e) where
return = Right
(Left
Hi all,
I'm doing some work with ASN.1, and I'm thinking about how to
represent the type BIT STRING.
The obvious, and inefficient representation would be
type BitString = [Bool]
A reasonable sparse representation might be
type BitString = [Integer]
where the integers represent the
On 9/15/06, Lennart Augustsson [EMAIL PROTECTED] wrote:
It's hard to tell what the best representation is if you don't know
what the operations that you are going to perform are. If all you
are going to do is I/O of bitstrings, then [Bool] could be great. If
you need to do bitwise boolean ops
Hi all,
Is there any deep and meaningful reason why Haskell doesn't have
anonymous discriminated union types?
I'm thinking of an example like:
data Amount = Amount Integer (Mg|G|Kg|T)
Now this particular case is perhaps unconvincing - a seperate Units
type would be quite sensible, however I'm
On 8/20/06, John Meacham [EMAIL PROTECTED] wrote:
C++ templates are a whole nother ball of wax.
And that's putting it politely. ;-)
T.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 8/18/06, John Meacham [EMAIL PROTECTED] wrote:
[lots of good argument before and after deleted]
There is a major difference though, in C++ (or java, or sather, or c#,
etc..) the dictionary is always attached to the value, the actual class
data type you pass around. in haskell, the
Perhaps your instances will work correctly with this data declaration?
Perhaps it might. But that misses an important point.
The biggest impediment to developing large robust applications with
Haskell is the opacity of its performance model. Haskell is fantastic
in very many ways, but this
81 matches
Mail list logo