Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.12 KB

README.md

File metadata and controls

52 lines (37 loc) · 1.12 KB

OpenDAL Haskell Binding (WIP)

Example

import OpenDAL
import qualified Data.HashMap.Strict as HashMap

main :: IO ()
main = do
  Right op <- operator "memory" HashMap.empty
  runOp op operation
 where
  operation = do
    writeOp op "key1" "value1"
    writeOp op "key2" "value2"
    value1 <- readOp op "key1"
    value2 <- readOp op "key2"

Build

  1. Build OpenDAL Haskell Interface
cargo build --package opendal-hs
  1. Build Haskell binding

If you don't want to install libopendal_hs, you need to specify library path manually by LIBRARY_PATH=${OPENDAL_ROOT}/target/debug.

LIBRARY_PATH=... cabal build

Test

LD_LIBRARY_PATH=... cabal test

Doc

To generate the documentation:

cabal haddock

If your cabal version is greater than 3.8, you can use cabal haddock --open to open the documentation in your browser. Otherwise, you can visit the documentation from dist-newstyle/build/$ARCH/ghc-$VERSION/opendal-hs-$VERSION/doc/html/opendal-hs/index.html.