# DA.Math import , missing module name

**URL:** <https://forum.canton.network/t/da-math-import-missing-module-name/2394>\
**Category:** App Development\
**Created:** [April 7, 2021, 2:36pm UTC](https://forum.canton.network/t/da-math-import-missing-module-name/2394 "2021-04-07T14:36:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amiracam](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@amiracam](https://forum.canton.network/u/amiracam)\
**Post date:** [April 7, 2021, 2:36pm UTC](https://forum.canton.network/t/da-math-import-missing-module-name/2394/1 "2021-04-07T14:36:07Z")

</div>

recreating some of the tutorial material. on my local VS Code project I’m trying to import DA.Math  
as per the DataTypes and Imports tutorial.

VSCode complains about “missing module name”

I notice that the daml.yaml has a dependency section which for me looks as such:

> dependencies:
> 
> - daml-prim
> - daml-stdlib
> - daml-script

this was generated via the java quickstart create .

Is there another dependency I should specify ?  
thanks

---

<div class="post-metadata">

**Author:** ![bernhard](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bernhard/32/356_2.png) [@bernhard](https://forum.canton.network/u/bernhard)\
**Post date:** [April 7, 2021, 2:40pm UTC](https://forum.canton.network/t/da-math-import-missing-module-name/2394/2 "2021-04-07T14:40:27Z")

</div>

The compiler expects the header (with pragmas and imports) to be followed by a line `module X where`, where `X` needs to match your file name. So if your file is `Main.daml`, write `module Main where`.

eg if your file currently contains

```haskell
import DA.Math

```

make it

```haskell
import DA.Math

module Main where

```

EDIT: I obviously got the order wrong. imports go after the module declaration:

```haskell
module main where

import DA.Math

```

---

<div class="post-metadata">

**Author:** ![amiracam](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@amiracam](https://forum.canton.network/u/amiracam)\
**Post date:** [April 7, 2021, 3:20pm UTC](https://forum.canton.network/t/da-math-import-missing-module-name/2394/3 "2021-04-07T15:20:25Z")

</div>

thanks, so I was copying in this from the tutorial:

> import DA.Math
> 
> answer: Int  
> answer = 42  
> diagonal: Decimal → Decimal → Decimal  
> diagonal a b = (a^2 + b^2) \*\* 0.5

for which it complains about DA.Math

this doesnt’ work either (see below) but I expect that there must be a module terminator ? I know its white space sensitive if so you would think that should suffice ?

![image](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/9/956c8039e11cd880461eb016ec3a2f4bf7774d1c.png)

Sorry for the newbieness , want to make sure I understand the lang itself and not create contracts by robotic copy/paste.  
I Googled for daml modules and could not readily find something that described the syntax and constraints, I’ll search thru the pdf I downloaded

VSCode is complaining about a parse error.  
“Functions” is the name of the file

---

<div class="post-metadata">

**Author:** ![amiracam](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@amiracam](https://forum.canton.network/u/amiracam)\
**Post date:** [April 7, 2021, 3:25pm UTC](https://forum.canton.network/t/da-math-import-missing-module-name/2394/4 "2021-04-07T15:25:08Z")

</div>

looked at the generated project and given that I changed it to this:

> module Functions where
> 
> import DA.Math

which no longer complains about an import issue but warns that its a redundant import perhaps part of the implicit “Prelude” dependency set ?

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [April 7, 2021, 3:44pm UTC](https://forum.canton.network/t/da-math-import-missing-module-name/2394/5 "2021-04-07T15:44:06Z")

</div>

“redundant” in this context means unused. If you use it, the warning should disappear. Here is a useless, minimal file that does not produce any warning:

```haskell
module Main where

import DA.Math

v = DA.Math.exp

```

---

<div class="post-metadata">

**Author:** ![amiracam](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@amiracam](https://forum.canton.network/u/amiracam)\
**Post date:** [April 7, 2021, 4:26pm UTC](https://forum.canton.network/t/da-math-import-missing-module-name/2394/6 "2021-04-07T16:26:18Z")

</div>

right , redundant since its of no current use, makes sense.

thanks
