
Hi, I'm writing a password manager that implements a dbus-api using the dbus[1] package. I'd like to separate the code that implements from the dbus api from the code that stores and retrieves the secrets (passwords). In Java I'd use an interface, e.g.: interface PasswordStore { void store(Path path, String secret, Map metadata); (String secret, Map metadata) retrieve(Path path); (String secret, Map metadata) search(Map criteria); } And the dbus-api would export this interface: dbusClient.export(PasswordStore store) What would be a Haskell way to do the same? My only idea is to define a record: data PasswordStore { store :: Path -> Secret -> MetaData -> IO () , retrieve :: Path -> IO (Secret, MetaData) , search :: Criteria -> IO (Secret, MetaData) } Thank you for any suggestions! Thomas Koch [1] http://hackage.haskell.org/package/dbus-0.10.9