# Importing templates into new modules

**URL:** <https://forum.canton.network/t/importing-templates-into-new-modules/1310>\
**Category:** App Development\
**Created:** [September 25, 2020, 6:21pm UTC](https://forum.canton.network/t/importing-templates-into-new-modules/1310 "2020-09-25T18:21:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leonid\_Rozenberg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/leonid_rozenberg/32/48_2.png) [@Leonid\_Rozenberg](https://forum.canton.network/u/Leonid_Rozenberg)\
**Post date:** [September 25, 2020, 6:21pm UTC](https://forum.canton.network/t/importing-templates-into-new-modules/1310/1 "2020-09-25T18:21:36Z")

</div>

In Main.daml I have

```haskell
template Asset
  with
    issuer : Party
    owner : Party
    name : Text
    dateOfAppraisal : Date
    value : Decimal
  where
    ensure name /= ""
    signatory issuer

```

but when I try to import that template into a Treasury.daml with

```haskell
module Treasury where

import Main (Asset)

template TreasurerRole
  with
    treasurer : Party
  where
    signatory treasurer

    controller treasurer can
      CreateAsset : ContractId Asset
        with
          owner : Party
          name : Text
          dateOfAppraisal : Date
          value : Decimal
        do
          create Asset with issuer = treasurer, ..

```

DAML complains on the “Asset” in the final line with:

> Message:  
> daml/Treasury.daml:21:18: error:  
> Not in scope: data constructor ‘Asset’  
> Perhaps you want to add ‘Asset’ to the import list in the import of  
> ‘Main’ (daml/Treasury.daml:5:1-19).

But I already imported _Asset_ from Main ?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [September 25, 2020, 6:24pm UTC](https://forum.canton.network/t/importing-templates-into-new-modules/1310/2 "2020-09-25T18:24:59Z")

</div>

`import Main (Asset)` will import the type `Asset`. What you need here is the value `Asset`, i.e., the constructor for the type. To import that you can use `import Main (Asset(..))` to import the type `Asset` together with all of its constructors or `import Main (Asset(Asset))` to import the type `Asset` and only the constructor `Asset`.

In this case the two are equivalent. The difference shows if you have a variant like `Either` in the standard library. Then `import Either(Left)` will only import `Left` but not `Right`.

There is no easy way to import just the constructor but not the type and I would generally discourage trying to do that. Having the types for the expressions you’re working with in scope means that you can add a type signature at any point which is quite convenient.
