Interfacing LIRC with Haskell - haskell

I've been using pyLirc while prototyping a small application in Python. For performance reasons (among others) I'm moving to Haskell, but can't find any modules providing similar functionality. Should I just stick with "lirc_client.h" or are there any alternatives?

There's no Haskell binding to Lirc yet. It doesn't look too hard.

Related

Options for wrapping a C++ library for Haskell (and other languages)

This question is about design / is fairly open-ended.
I'd like to use OpenCV, a large C++ library, from Haskell.
The closest solution at the moment is probably Arjun Comar's attempt to adapt the Python / Java binding generator.
See here, here, and here.
His approach generates a C interface, which is then wrapped using hsc2hs.
Due to OpenCV's lack of referential transparency in its API, as well as its frequent use of call parameters for output, for Arjun's approach to fully succeed he'll need to define a new API for OpenCV, and implement it in terms of the existing one.
So, it seems it might not be too much extra work to go whole-hog and define an API using an interface description languages (IDL), such as SWIG, protobuf-with-RPC, or Apache Thrift.
This would provide interfaces to a number of languages besides Haskell.
My questions:
Is there anything better than SWIG for a server-free solution?
(I just want to call into C++; I'd rather not go through a local server.)
If there's no good server-free solution, should I use protobuf-with-RPC or Thrift?
Related: How good is Thrift's Haskell support?
From the code, it looks like it needs updating (I see references to GHC 6).
Related: What's a good protobuf-with-RPC solution?
With Apache Thrift, you get Haskell support. You are correct, code is not generally "latest", but you rarely care. You can do complex things on other abstraction levels and keep things as simple as possible at messaging level.
Google Protobuf has no support for Haskell, nor does SWIG. With Protobuf you get C++, Java, JavaScript and Python, to my knowledge the main languages at Google. Have a look at this presentation. Without contest, Thrift and Protobuf are the best in house.
It seems in your case you have to go with Thrift, as it supports Haskell.
It sounds like the foreign function interface for C++ is what you want:
Hackage,
Github
Disclaimer: I haven't used it, only heard good things about it.

Haskell `ncurses` library

I would like to use a text-based UI in my Haskell program. I found some bindings for the ncurses library (see also hscurses or ncurses, which one to use?). The hscurses and nanocurses packages are just simple wrappers around the C library, while vty isn't very well documented and a bit ugly (for example mixing snake_case and CamelCase).
The ncurses library on Hackage looks much more pretty and provides API which nicely fits Haskell. The problem is that it doesn't seem to implement some crucial features, like resizing or refreshing the windows.
So my question is:
is there any other Haskell text UI library, either ncurses-based or not, which I missed?
if there isn't anyone, is it possible to extend the ncurses Haskell library to at least support window refreshing and resizing? (this should be probably consulted with the project owner, but I need the solution quickly)
EDIT:
I finally used nscurses without windows (and panels) to avoid the troubles with refreshing them. I had problems with output to bottom-right corner of a window (a very similar issue was reported for Python's ncurses binding). I solved it by not writing there :).
Have you looked at vty-ui? It has a very nice user manual with lots of examples. I believe it's essentially a wrapper around vty.
I've used nanoncurses and hscurses succesfully, my hmp3 app has a binding that was the basis for nanocurses.
No matter what you probably will want a nice high level API. hscurses does have a box abstraction at least.
You'd be fine going with hscurses.
There is another good choice for Text-based user interfaces in haskell;
Brick is written by jtdaugherty, the same person that developed vty-ui which is Deprecated now.
The API is Declarative, which is Better for Presenting a language like Haskell.
also the Documentation was great and complete.

hot code loading in haskell

It is possible to implement hot code swapping with Haskell? I was reading about Erlang which sparked up my interest, I would like to use these features with Haskell.
See the package dyre, which was designed for exactly this kind of purpose. There's also hotswap, but it hasn't been updated for a few years now.
There is plugins package in Cabal, which provides facilities for loading plugins code. But in general Haskell is much more hostile to changing code in runtime than dynamic, bytecode-driven Erlang.

Is there some standard Haskell library dealing with process communication?

Googled a little bit, but still not sure whether there is some standard library in Haskell dealing with inter-process communication stuff, since I am new to Haskell, I also hope that the library is well documented, better some small example (e.g. passing some data types and use them)....
Many commercial and open source IPCs have Haskell bindings:
0MQ
Thirft
Messagepack
I have made the best experiences with Messagepack because it is quite light weight.
I've created a simple library to solve the most basic aspects of this problem: http://hackage.haskell.org/package/ipcvar

Haskell GUI programming tools

This might seems silly question but for me it is annoying.
I have installed Haskell platform in my PC using Portable option from the installation options as I do not have admin privileges. So the total Haskell files are now stored in D Drive and I am able to use this without any problems. But when I search for GUI programming in Haskell I have got many articles in Google and I came to final conclusion that I need another library or tool or plugin(I dont know which is correct) to make GUI programming possible in Haskell.
But here my questions are:
What are best tools for windows for GUI programming?
How to install the extra library or tool and attach it to
portable Haskell platform?
The Haskell wiki has a comprehensive list of available GUI libraries for Haskell.
The problem with GUI programming in Haskell is not so much the lack of available tools and libraries, but the fact that using Haskell to write GUI programs in the usual imperative event driven style doesn't take full advantage of the functional nature of Haskell.
There are a number of approaches aiming to address this problem, but, as far as I know, they are all pretty much at the "research" stage, meaning they are not yet quite as mature (both in theory and in practice) as the mainstream (non-functional) techniques. If you are interested in this direction, take a look at some of the functional reactive projects listed in that wiki page, as well as reactive-banana.
As for your second question (how to install Haskell libraries), you can use cabal, which is included in the Haskell Platform. This page explains how to install packages with it.

Resources