Is it possible to import a specific template from a module?

Is it possible to import a specific template from a module?

2 Likes

You could try using an import list, something like

import M (T(..))

where M is the module and T is the template name.

1 Like

Note that this will only import the template. If your template has choices other than Archive that 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”.

5 Likes

@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?

1 Like

Right now we don’t have plans for this.

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.