Skip to content
Discussions/App Development/Does there exist a Haskell code-generator?Forum ↗

Does there exist a Haskell code-generator?

App Development2 posts153 views1 likesLast activity Jan 2024
LU
LucianoOP
Dec 2023

i.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.com

digital-asset/daml/blob/af7545ff46e290dbbb8ccc4d4792c31945efc539/language-support/hs/bindings/examples/nim/src/DA/Ledger/App/Nim/Domain.hs#L64-L70


      
  1. instance IsLedgerValue Move where
  2. toValue Move{pileNum,howMany} =
  3. VRecord(Record{rid=Nothing,
  4. fields=[
  5. RecordField "" (toValue pileNum),
  6. RecordField "" (toValue howMany)]})
  7. 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 2024

I 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.

← Back to Discussions