News aggregator
Evaluation-State Assertions in Haskell
CoArbitrary
More stable basic libraries?
I would like to see a companion to http://hackage.haskell.org/package/haskell2010 that does a similar thing with package imports to pull in all the parts of base which are not covered by the haskell2010 module. (Actually, I would like to see base split into multiple packages, but that's more radical.) This would allow coding primarily against the stable haskel2010 API for the really important modules, without losing access to operations defined in the many other modules in base which would allow for more stability across GHC releases (since the API in haskell2010 does not get broken).
submitted by singpolyma[link] [1 comment]
Vim-users.jp - Hack #241: Haskellimport
Can anyone provide a little direction for a Graph API?
Hello everyone,
I'm in my third year of computer science at university, and I realized that I do not know how to implement and manipulate graphs as well as I should, so I decided to remedy that by writing my own little graph library and implementing some common graph algorithms.
I have found that designing a nice API for graphs is harder than I thought. I'd love if someone could either point me to a common API or provide guidance as to which functions I need to define.
I've decided to start by defining my own graph type:
data Graph v w = Graph { vertices :: [v], edges :: [(v, v, w)] }Where v is the type of the vertices (is there a difference between vertex and node by the way?) and w is the type of the weight on the edges. For now, I'm not super concerned about efficiency, I'll get to alternative representations later. Here are some of my questions about the API:
- When inserting an already existing vertex into the graph, would it be better to signal it by either returning Maybe (Graph v w) or by raising an exception, or should I just return the graph as is?
- Same question for edges; if there is already an edge from a to b with a weight w, should adding an edge from a to b with a weight u raise an error, replace the weight, or do I just ignore that new edge?
- What if I insert an edge from a to b, but either of those vertices are not in the vertices list? Do I add them and add the edge or raise an error?
Thanks for the help.
submitted by gnuvince[link] [12 comments]
xml conduit
Hello
I am just introducing myself here and just want to say hi. I am hobbyist and what not......cheers
submitted by tertl3[link] [1 comment]
Introducing fixed-points via Haskell
performance question
ICFP 2013: Call for papers
ICFP 2013: Call for papers
cabal-dev add-source
NYC Haskell Meetup Video: Coding and Reasoning with Purity, Strong Types and Monads
language-puppet: The hsfacter package
This blog post is not about language-puppet, but might be of interest to my fellow sysadmins with an interest in Haskell. I recently worked with Logstash in a way that might not be typical, as all my messages are emitted by services that are Logstash-aware: they directly write JSON messages to the TCP input of the Logstash server. This means that most of the features (and some would say, the whole point) of Logstash were of no use to me.
I stuck with my grand mission of rewriting the handful of useful Ruby programs, and wrote a new package. I based almost everything around the excellent conduit abstraction. It has the following features:
- Haskell types for representing Logstash messages, along with the type-classes necessary for converting them from and to JSON
- An ElasticSearch conduit, using the bulk insert API
- A Redis source using the pipelining features of the hedis package, and a simple Redis sink
- A Logstash listener, based on the TCP listener from network-conduit, able to accept latin1 and UTF-8 messages at the same time
- A pair of “retrying” sinks, one using a Socket and the other establishing TCP connections. They are used for garanteed delivery of a whole ByteString segment, retrying to connect until it is sent (this is obviously useful for JSON messages)
- A few functions for handling bulk APIs in Conduits
- And finally, the coolest part, a few helper functions that will let you route between conduits !
The last part was made after a little discussion on the Haskell-Cafe mailing list. It is built with with stm-conduit, which already has a helper function for merging sources. This package introduces the other useful functionnality: the ability to “route” items coming from a source to several sinks. The main function, branchConduits, works by taking a Source, a routing function, and a Sink list. The routing function associates a (possibly empty) list of integers to every item coming from the Source. These integers directly map to the corresponding Sink, letting you define the routing policy.
The package includes a few examples of common tasks, all of them with acceptable runtime performance, such as :
- Moving messages from a TCP server to Redis
- Moving messages from Redis to Elasticsearch
- Routing messages between conduits
So if you need more control, or much better performance, than what you would get from Logstash, and you are not afraid to write (a lot of) code, please use this package and let me know what is missing and/or buggy!