Clarify deprecation of `DA.Next.*` in LF 1.11

In the Daml Connect 1.10.0 Release notes, it says:

TextMap itself continues to be supported as there are use-cases where it provides a nicer representation on the API than GenMap . Generic maps are represented as lists of tuples on the APIs. In contrast, TextMap is represented as a JSON object on the JSON API.

However, as of LF 1.11 target, any references to DA.Next.{Map,Set} throw a deprecation warning in the compiler.

This sends a mixed message.

What is the actual intent with the DA.Next data structures? Will they be eventually removed, or do we plan to keep them around as an alternative?

1 Like

We continue to support the bare TextMap, i.e., DA.TextMap which has the key type fixed to Text. What is deprecated are the wrappers for that that allow you to use other key types provided you define translations from and to Text via the MapKey instance.

So you have one of two options:

  1. If you have actual Text keys, use DA.TextMap if you want the nicer JSON representation.
  2. For every other key type use DA.Map.
2 Likes

Ok, got you - I was confusing DA.TextMap with DA.Next.Map (they even rhyme :laughing:) … or are they related in some way? Are you saying that type DA.TextMap = DA.Next.Map Text?

Also, what about DA.Next.Set? Is there any use case for this?

1 Like

They are wrappers around DA.TextMap. You can take a look at the definition for DA.Next.Map and the definition for DA.Next.Set.

For DA.Next.Set, I recommend to switch to DA.Set instead.

1 Like