I must admit, I haven’t used it for a while, but it still ought to build if you have a full Haskell Platform installation, and follow the instructions. Let me know if you want any help.

I’d also be interested in taking this further, as I rather got distracted.

]]>I am interested in working with dynamic graphs and how some of their structures can be improved (i.e. trees, paths, etc). I have read a bit of your contribution to Haskell, more specifically on monads for the MapReduce model.

I am wondering if we can be in touch through email and also if you do not mind to suggest me some reading material to start with.

A big question for me is perhaps:

In a daily dynamic network (graph) such Internet, how it is possible to deal with a simple computation as SSSP (single-source shortest path) or reachability? Same for functional programming language since intermediate graphs are potentially generated?

Regards

JC

]]>pairThemF x = (((,) x) \)

]]>pairThemF x = (((,) x) )

the applicative operator () got left out somehow..

— gene

]]>pairThemF

:: forall (f :: * -> *) a a1. Functor f => a1 -> f a -> f (a1, a)

pairThemF x = (((,) x) )

pairThemF 5 [10..18]

[(5,10),(5,11),(5,12),(5,13),(5,14),(5,15),(5,16),(5,17),(5,18)]

pairThemF “Integer” [1..7]

[(“Integer”,1),(“Integer”,2),(“Integer”,3),(“Integer”,4),(“Integer”,5),

(“Integer”,6),(“Integer”,7)]

pairThemF “Integer” (Just 8)

Just (“Integer”,8)

pairThemF “Integer” Nothing

Nothing

=========

The monadic attack would be something like:

[1..5] >>= return . (\a -> ((,) “Integer”) a)

[(“Integer”,1),(“Integer”,2),(“Integer”,3),(“Integer”,4),(“Integer”,5)]

or if you like for getting the list on the other end of things and throwing in some arrow notation… just for fun!!:

pairThemM

:: forall (m :: * -> *) a b. Monad m => a -> m b -> m (a, b)

pairThemM z xs = (((\a -> ((,) z) a) >>> return) =<<) xs

Which allows the same as for the Applicative above:

pairThemM "integer" [3..6]

[("integer",3),("integer",4),("integer",5),("integer",6)]

—

pairThemM "integer" (Just 12)

Just ("integer",12)

Lots of ways to skin a cat in Haskell, and none of them wrong.. even the bit of waste involved in producing a list to zip..

— cheers, gene

]]>