resolve #19 add Haskell API