# List type signatures

**URL:** <https://forum.canton.network/t/list-type-signatures/3894>\
**Category:** App Development\
**Created:** [February 10, 2022, 4:56pm UTC](https://forum.canton.network/t/list-type-signatures/3894 "2022-02-10T16:56:45Z")\
**Posts on this page:** 4\
**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:** [February 10, 2022, 4:56pm UTC](https://forum.canton.network/t/list-type-signatures/3894/1 "2022-02-10T16:56:45Z")

</div>

Sometimes when I want to explain that a list is just a parameterized data structure, I want to avoid writing `[a]`, is there a way to use the word `List` in a type definition:

For example, instead of

```haskell
filter : (a -> Bool) -> [a] -> [a]

```

```haskell
filter : (a -> Bool) -> List a -> List a

```

I get a scary warning about imports when I try the above.

---

<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:** [February 10, 2022, 4:58pm UTC](https://forum.canton.network/t/list-type-signatures/3894/2 "2022-02-10T16:58:55Z")

</div>

The warning isn’t all that scary:

```haskell
  daml/Main.daml:8:8: warning:
  In the use of type constructor or class ‘List’
  (imported from Prelude, but defined in DA.Internal.Compatible):
  Deprecated: "Daml compatibility helper, use [a] instead of 'List a'"

```

You can safely ignore that if you want.

Alternatively, you can define your own synonym which then does not trigger the warning:

```haskell
module Main where

import Prelude hiding (List)

type List a = [a]

test : List a -> List a
test = identity

```

---

<div class="post-metadata">

**Author:** ![akrmn](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/akrmn/32/2484_2.png) [@akrmn](https://forum.canton.network/u/akrmn)\
**Post date:** [February 10, 2022, 5:20pm UTC](https://forum.canton.network/t/list-type-signatures/3894/3 "2022-02-10T17:20:33Z")

</div>

I’d personally prefer if the deprecation were the other way around, that is, suggesting `List a` instead of `[a]`. I think that would fit better with `Daml`'s preference for simpler terms, such as `Action` instead of `Monad`.

---

<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:** [February 10, 2022, 7:13pm UTC](https://forum.canton.network/t/list-type-signatures/3894/4 "2022-02-10T19:13:01Z")

</div>

@akrmn fair point but I think the breakage from that is too large at this point.
