Skip to content
CCPEDIAby Unity Nodes
App Development

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

7 posts543 views9 likesLast activity May 2020

  1. meetOP 2

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

  2. rohanjr 1

    You could try using an import list, something like

    import M (T(..))
    

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

  3. cocreature 5

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

  4. 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?

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

  6. meet
    cocreature:

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

    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?

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