Is it possible to import a specific template from a module?
- meetOP 2
Is it possible to import a specific template from a module?
- rohanjr 1
You could try using an import list, something like
import M (T(..))where
Mis the module andTis the template name. - cocreature 5
Note that this will only import the template. If your template has choices other than
Archivethat you want to exercise you will need to import them separately, e.g.,import M (T(..), MyChoice(..))There is currently no way to say “import a template and all its choices”.
- meet 1
@cocreature I see - that feels awkward from a developer experience perspective. Are there any future plans to allow automatic import of all choices of a template when you import the template?
- cocreature
meet:Are there any future plans to allow automatic import of all choices of a template when you import the template?
Right now we don’t have plans for this.
- meet
cocreature:Note that this will only import the template. If your template has choices other than
Archivethat you want to exercise you will need to import them separately, e.g.,import M (T(..), MyChoice(..))There is currently no way to say “import a template and all its choices”.
I assume the reason is you’re importing the underlying data records autogenerated for every template and choice so need to explicitly specify each one?
- cocreature
meet:I assume the reason is you’re importing the underlying data records autogenerated for every template and choice so need to explicitly specify each one?
Exactly, we just piggy-back on top of the standard Haskell exports and imports so there is nothing special for templates here.