On Sat, 12 Jun 2010 17:10:07 -0400
aditya == aditya siram aditya.si...@gmail.com wrote:
aditya Unfortunately literate programming doesn't really have the tool
aditya support yet. I use emacs for Haskell development and loading
aditya Haskell code in to the REPL will be an issue if you're editing
So the other day I was writing some code, and I ended up wanting to have
a collection of data indexed in more than one way. In other words, I
wanted fast lookup with several different keys.
Initially I built something using two Data.Map objects to represent the
two lookup keys, but then I
On Sun, Jun 13, 2010 at 01:09:24PM +0100, Andrew Coppin wrote:
Does anybody have a less-insane way of doing this?
Did you take a look at happstack-ixset[1]?
[1] http://hackage.haskell.org/package/happstack-ixset
--
Felipe.
___
Haskell-Cafe mailing
What I ended up writing is this:
http://www.hpaste.org/fastcgi/hpaste.fcgi/view?id=25782
lookup :: KeyID - Key - Container - Maybe Value
Does anybody have a less-insane way of doing this?
Sure:
type MyMap = Map (KeyID, Key) Value
Don't use multiple keys. Put the keys into a tuple and
Felipe Lessa wrote:
On Sun, Jun 13, 2010 at 01:09:24PM +0100, Andrew Coppin wrote:
Does anybody have a less-insane way of doing this?
Did you take a look at happstack-ixset[1]?
No. I'll take a look at it.
(From the looks of it, it seems to be using TH and/or run-time checks to
On 13 June 2010 15:23, Andrew Coppin andrewcop...@btinternet.com wrote:
Felipe Lessa wrote:
On Sun, Jun 13, 2010 at 01:09:24PM +0100, Andrew Coppin wrote:
Does anybody have a less-insane way of doing this?
Did you take a look at happstack-ixset[1]?
No. I'll take a look at it.
(From
Marc Weber wrote:
Does anybody have a less-insane way of doing this?
Sure:
type MyMap = Map (KeyID, Key) Value
Don't use multiple keys. Put the keys into a tuple and use that as key.
Let me know whether this is what you were looking for.
Trouble is, this requires you to have
Philippa Cowderoy wrote:
On 13/06/2010 14:52, Andrew Coppin wrote:
Marc Weber wrote:
Does anybody have a less-insane way of doing this?
Sure:
type MyMap = Map (KeyID, Key) Value
Don't use multiple keys. Put the keys into a tuple and use that as key.
Let me know whether this is what you
Excellent answer! Splitting the Symantics class into pieces is one of
the techniques that we didn't need for solving the original problem
(tagless partial evaluation without resorting to fancy types) that set
us on this track. Which is too bad, because it would have made a nice
addition. The
Dear Jacques,
I have recently found something new that might also prove to be useful
for EDSLs.
http://blog.sigfpe.com/2009/05/three-projections-of-doctor-futamura.html
Dan's blog post doesn't give any code or implementation but in a way it
tackles the same problem, and since you also
Marc Weber wrote:
Andrew Coppin wrote:
What I ended up writing is this:
http://www.hpaste.org/fastcgi/hpaste.fcgi/view?id=25782
lookup :: KeyID - Key - Container - Maybe Value
Does anybody have a less-insane way of doing this?
Sure:
type MyMap = Map (KeyID, Key) Value
Don't
Hi,
I am trying to write a routine that would generate a graph - where each
vertex would be a string.
type Graph v = [(v,[v])] -- list of tuples of vertices and adjacent
vertices list
addEdgeToGraph :: Graph - String - String - Graph
I am having trouble coming up with the body of this function
Hello,
My idea for solving this problem was to try to use something similar
to a kd-tree. I have a proof of concept for 2 keys here:
http://src.seereason.com/haskell-kdmap/
But, to extend it to an arbitrary number of keys may need template
haskell.
The basic concept is to build a
Excerpts from Jeremy Shaw's message of Sun Jun 13 19:16:02 +0200 2010:
Hello,
My idea for solving this problem was to try to use something similar
to a kd-tree. I have a proof of concept for 2 keys here:
http://src.seereason.com/haskell-kdmap/
But, to extend it to an arbitrary number
* C K Kashyap ckkash...@gmail.com [2010-06-13 22:45:44+0530]
Hi,
I am trying to write a routine that would generate a graph - where each
vertex would be a string.
type Graph v = [(v,[v])] -- list of tuples of vertices and adjacent
vertices list
addEdgeToGraph :: Graph - String - String
http://hackage.haskell.org/package/properties-0.0.2
http://hackage.haskell.org/package/properties-0.0.2Properties can
use QuickCheck properties in the same way than assertions are used,
for causal debugging of real programs. It also add an human readable
structure for grouping properties for
Hello all,
I need your advice about how to browse code which was written by someone else
(Paul Hudak's Euterpea, to be precise, apx. 1 LOC). I had set some hopes
on leksah, and it indeed shows me the interfaces, but I have not yet
convinced it to show me more than that.
I ran haddock over
Hi Martin
With Haddock you can also make the highlighted source as per docs
hosted on Hackage. Install hscolour, then when you invoke haddock on
the cabal file add the --hyperlink-source flag. No hyperlinks in the
source though, just colourization.
Thomas Hallgren had another source-to-html tool
Excerpts from Martin Drautzburg's message of Sun Jun 13 22:32:18 +0200 2010:
Anyways, how do you guys do it, i.e. how to you dive into non-trivial foreign
code?
I use Vim and tag files generated by Vim.
Using gnu idutils or such you can find any occurences of words very
fast in large code
Suppose I have some parser 'p'. I want to parse it as well as get its
span in the text. So I could write
\begin{code]
pWithLocation = do
loc_start - getPosition
pval - p
loc_end - getPosition
return (pval,loc_start,loc_end)
\end{code}
except that loc_end gives me the location _after_
On Sun, Jun 13, 2010 at 4:17 PM, Roman Cheplyaka r...@ro-che.info wrote:
Suppose I have some parser 'p'. I want to parse it as well as get its
span in the text. So I could write
\begin{code]
pWithLocation = do
loc_start - getPosition
pval - p
loc_end - getPosition
return
* Antoine Latter aslat...@gmail.com [2010-06-13 16:47:28-0500]
On Sun, Jun 13, 2010 at 4:17 PM, Roman Cheplyaka r...@ro-che.info wrote:
Suppose I have some parser 'p'. I want to parse it as well as get its
span in the text. So I could write
\begin{code]
pWithLocation = do
loc_start -
On Mon, Jun 14, 2010 at 12:10 AM, Roman Cheplyaka r...@ro-che.info wrote:
Of course most parsers don't consume trailing newlines. But I was
writing general function to use in many places in the code which would
recover the end location. In most cases it just subtracts 1 from the
column number,
I love this list ... thanks Roman.
I take it that there is nothing obviously inefficient about this approach to
graph - as in the graph type.
On Mon, Jun 14, 2010 at 12:02 AM, Roman Cheplyaka r...@ro-che.info wrote:
* C K Kashyap ckkash...@gmail.com [2010-06-13 22:45:44+0530]
Hi,
I am
C K Kashyap ckkash...@gmail.com writes:
I love this list ... thanks Roman.
I take it that there is nothing obviously inefficient about this approach to
graph - as in the graph type.
Sure there is (using p = |V|, q = |E|):
* Finding a particular node is O(p).
* Adding an edge to an already
Thanks Roman.
I think I'll try out Data.Graph in that case.
On Mon, Jun 14, 2010 at 8:53 AM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
C K Kashyap ckkash...@gmail.com writes:
I love this list ... thanks Roman.
I take it that there is nothing obviously inefficient about this
I'm computing a communication graph from Twitter data and then scan it
daily to allocate social capital to nodes behaving in a good karmic
manner. The graph is culled from 100 million tweets and has about 3
million nodes. First I wrote the simulation of the 35 days of data in
Clojure and then
Hi Cafe,
I've been doing Haskell for a few months, and I've written some mid-sized
programs and many small ones. I've read lots of documentation and many
papers, but I'm having difficulty making the jump into some of the advanced
concepts I've read about.
How do people build intuitions for
deliverable:
I'm computing a communication graph from Twitter data and then scan it
daily to allocate social capital to nodes behaving in a good karmic
manner. The graph is culled from 100 million tweets and has about 3
million nodes. First I wrote the simulation of the 35 days of data in
29 matches
Mail list logo