Does there exist a Haskell code-generator?
App Development2 posts153 views1 likesLast activity Jan 2024
LU
LucianoOP
Dec 2023i.e. a conversion from LF Values into Haskell data types?
Ideally one that would be compatible with
github.com//github.com/digital-asset/daml/tree/main/language-support/hs/bindings
All the examples in that module have the conversion hand-coded, for instance here:
github.comdigital-asset/daml/blob/af7545ff46e290dbbb8ccc4d4792c31945efc539/language-support/hs/bindings/examples/nim/src/DA/Ledger/App/Nim/Domain.hs#L64-L70
- instance IsLedgerValue Move where
- toValue Move{pileNum,howMany} =
- VRecord(Record{rid=Nothing,
- fields=[
- RecordField "" (toValue pileNum),
- RecordField "" (toValue howMany)]})
- fromValue = undefined -- we never receive moves from the ledger
and it made me wonder whether there exists a code generator in (or outside) the main Daml repo, or whether one has existed in the past.
I also noticed the typescript code-generator is written in Haskell, so it wouldn’t be a far throw from there to hs.
GA
Gary_Verhaegen
Jan 2024I don’t think there is one and as far as I’m aware we are not looking to expand the list of generated languages at the moment.
@Bas_van_Gijzel or @Remy can probably give you a more definite answer.