Fungible - Default implementation for split and merge as functions

Hi,

In our project we’ve created a new Interface for Holdings (Withdrawable). The idea is to extend Daml.Finance.Holding.Fungible with this new behaviour. We’ve written a new module MyProject.Holding.FungibleWithdrawable with the contents from Daml.Finance.Holding.Fungible (excepting getRestAmount function which we can import from Daml.Finance.Holding.Fungible) but we ended up with code duplicated.

Would it be possible to extract the logic on split and merge functions ( interface instance Fungible.I ) into functions (say splitImpl and mergeImpl) in the same way it’s done with transferImpl, acquireImpl, releaseImpl, etc ?

Thanks
Jose

Hi @jvelasco.intellecteu,

I think that makes sense. I have created a ticket where we can track it here:

Thanks,
Johan

1 Like