I haven't seen it done before, but it's possible.

Use Haskell's FFI to wrap libruby . Your main executable will be written in Haskell, which will call ruby_init() and related functions, in order to run the Ruby interpreter in-process. This does allow you to run arbitrary Ruby code, though.

. Your main executable will be written in Haskell, which will call and related functions, in order to run the Ruby interpreter in-process. This does allow you to run arbitrary Ruby code, though. Use Ruby's FFI to wrap a GHC module as a library. Your Ruby script must call hs_init() , and can only access foreign export ed functions.

You'll need to write glue code, some in C, to get either of those two options working.

Run Ruby and Haskell in separate processes, using some IPC to communicate between them. Maybe XML-RPC (Haskell/Ruby), or JSON (Haskell/Ruby) over sockets, or maybe even just pipes with your own custom protocol.

I don't know what your requirements are, but this is what I'd go for -- it's a lot easier.