Skip to content
Discussions/App Development/Fungible - Default implementation for split and merge as functionsForum ↗

Fungible - Default implementation for split and merge as functions

App Development2 posts232 views1 likesLast activity Feb 2023
JV
jvelasco.intellecteuOP
Feb 2023

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

JO
Johan_Sjodin
Feb 2023
jvelasco.intellecteu:

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 ?

Hi @jvelasco.intellecteu,

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

github.com/digital-asset/daml-finance

Factor out `splitImpl` and `mergeImpl` from the `Fungible` implementation

opened 04:23PM - 23 Feb 23 UTC
closed 09:30AM - 17 Mar 23 UTC
component-core gardening user-experience

Thanks,
Johan

← Back to Discussions