Re: [Haskell-cafe] Is the following implemented by a sparse matrix representation? type Graph n w = Array (n, n) (Maybe w)

2013-07-10 Thread Thomas Horstmeyer
Looks like the graph is represented by an adjacency matrix, where the element at (a, b) tells you whether there is an edge from node a to node b with weight x or not by having the value (Just x) or Nothing, respectively. Whether the matrix is sparse depends on the data, i.e. how many edges are

Re: [Haskell-cafe] Trouble with Debug.Trace when using a library

2013-05-15 Thread Thomas Horstmeyer
Perhaps x is evaluated earlier than you think, i.e. before the trace (due to some strictness analysis?). But this is a just a guess. I usually use trace outermost in my expression, not within a let. I never had a problem with it: fA :: SomeInput - SomeResult fA a = trace (Entering fA) $ f

Re: [Haskell-cafe] Data.Sequence and replicateM

2013-01-25 Thread Thomas Horstmeyer
Hi, isn't the correct type context for f the following? f :: (Functor m, Monad m) = Int - m a - m (Seq a) So your f really is a kind of specialization of g. Could the reason for f performing better be list fusion? Anything happening inside Control.Monad.replicateM should be subject to it.

Re: [Haskell-cafe] Is there a tool to see reduction steps?

2012-10-17 Thread Thomas Horstmeyer
There is Hood [11 and its graphical front-end GHood [2]. I have never used them myself however, only seen them demonstrated. Normally, using Debug.Trace is enough for me. [1] http://www.ittc.ku.edu/csdl/fpg/Tools/Hood [2] http://community.haskell.org/~claus/GHood/ Thomas Am 10.10.2012

Re: [Haskell-cafe] Huffman Codes in Haskell

2010-06-25 Thread Thomas Horstmeyer
How would you implement bfnum? (If you've already read the paper, what was your first answer?) Actually, my first thought was Just traverse the tree twice. Then it dawned on me, that the tree could be of infinite size and I settled for the following solution: bfsn :: Tree a - Tree Int

Re: [Haskell-cafe] Bulk Synchronous Parallel

2010-04-26 Thread Thomas Horstmeyer
as well. The Eden webpage will be updated as soon as we have a pre-release of the 6.12 branch. Best regards, Thomas Horstmeyer (Eden group Marburg) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe