# Confusion Regarding Recent @deprecated M0235 Annotations in Core Library (Map & Result)

**URL:** <https://forum.dfinity.org/t/confusion-regarding-recent-deprecated-m0235-annotations-in-core-library-map-result/62764>\
**Category:** Motoko\
**Tags:** Discussing\
**Created:** [January 16, 2026, 4:36am UTC](https://forum.dfinity.org/t/confusion-regarding-recent-deprecated-m0235-annotations-in-core-library-map-result/62764 "2026-01-16T04:36:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisL20J](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/chrisl20j/32/25244_2.png) [@ChrisL20J](https://forum.dfinity.org/u/ChrisL20J)\
**Post date:** [January 16, 2026, 4:36am UTC](https://forum.dfinity.org/t/confusion-regarding-recent-deprecated-m0235-annotations-in-core-library-map-result/62764/1 "2026-01-16T04:36:27Z")

</div>

Hello,  
I would like to share some confusion I have encountered while working with the recent core library updates, particularly around a number of newly introduced `@deprecated M0235` annotations. I may be missing some context, so I am outlining my current understanding and uncertainties below.

### 1. Deprecation warnings during development

Recently, the compiler began reporting that the `replace` method in the core `Map` module, as well as parts of the `Result` module, are deprecated. Without any obvious accompanying explanation, this has made it difficult for me to understand how these APIs are expected to be used going forward.

### 2. Multiple `Map` mutation APIs marked as deprecated

While reviewing the source code, I noticed that `Map.replace` is not the only affected API. Other methods with similar purposes, such as `Map.insert` and `Map.swap`, are also annotated with `@deprecated M0235`.

From my current perspective, this seems to leave `Map.add` as the only non-deprecated mutation method. I am unsure whether this interpretation is correct. It also made me wonder what the original motivation was for providing multiple mutation APIs with overlapping behavior, and what considerations led to the decision to deprecate most of them now.

### 3. Deprecation of `Map.toPure` and `Map.fromPure`

I noticed that both `Map.toPure` and `Map.fromPure` are marked as deprecated.

In addition, similar to what is seen in the `Result` module, the `type` declarations in `pure/Map`, and in several other `pure/` modules, are also annotated with `@deprecated M0235`. From my perspective, it is unclear whether this combination of deprecations is meant to discourage conversion between `Map` and `pure/Map`, or whether it indicates that all `pure/` modules are planned to be deprecated.

### 4. Deprecation of `type Result` in the `Result` module

In the `Result` module, the `type Result` declaration itself is marked as deprecated.

Seeing that similar `@deprecated M0235` annotations appear on `type` declarations in `pure/Map` and other `pure/` modules, I am unsure whether these annotations are intended to discourage direct use of specific type aliases, or whether they indicate a wider plan to phase out entire modules rather than individual APIs.

### 5. Missing context around the December 10 update

It appears that the core library update on **December 10** introduced a large number of `@deprecated M0235` annotations. However, so far I have not been able to find related commits description, changelog entries, official documentation, or public discussions that explain the intent behind this change.

Because of this, I am finding it difficult to understand the broader direction these deprecations are pointing toward, or how developers are expected to adapt.

If the `Result` module, as well as other modules where the `type` declarations are marked with `@deprecated M0235`, such as `Region`, are intended to be fully deprecated and eventually removed, what are the recommended replacements for these modules?

* * *

I wanted to share these observations in case others have run into similar uncertainty, or in case there is existing context that I may have overlooked.  
Thank you.

---

<div class="post-metadata">

**Author:** ![alex-df](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alex-df/32/12155_2.png) [@alex-df](https://forum.dfinity.org/u/alex-df)\
**Post date:** [January 16, 2026, 7:15am UTC](https://forum.dfinity.org/t/confusion-regarding-recent-deprecated-m0235-annotations-in-core-library-map-result/62764/2 "2026-01-16T07:15:54Z")

</div>

Thank you for your message!

sorry for the confusion, this is a caffeine-related deprecation (see the motoko [changelog](https://github.com/caffeinelabs/motoko/blob/master/Changelog.md)), where these projects won’t use the methods annotated with the M0235 code.

This deprecation does not affect regular users.

---

<div class="post-metadata">

**Author:** ![Seb](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/seb/32/10340_2.png) [@Seb](https://forum.dfinity.org/u/Seb)\
**Post date:** [January 22, 2026, 8:50am UTC](https://forum.dfinity.org/t/confusion-regarding-recent-deprecated-m0235-annotations-in-core-library-map-result/62764/3 "2026-01-22T08:50:40Z")

</div>

So we should just deal with it basically?  
Quite concerned that regular users of Motoko are being put aside. In just one major version of `core` we got breaking changes and depreciation warnings that don’t concern us on some of the most used types/modules.

---

<div class="post-metadata">

**Author:** ![kritzcreek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kritzcreek/32/267_2.png) [@kritzcreek](https://forum.dfinity.org/u/kritzcreek)\
**Post date:** [January 22, 2026, 11:07am UTC](https://forum.dfinity.org/t/confusion-regarding-recent-deprecated-m0235-annotations-in-core-library-map-result/62764/4 "2026-01-22T11:07:59Z")

</div>

> Quite concerned that regular users of Motoko are being put aside.

I can assure you that the Motoko Team is not putting its human users aside. We’ve been strong advocates whereever we can, and have fought tooth and nail for the new context-dot and implicits features to be backwards compatible for our existing users.

> In just one major version of `core` we got breaking changes and depreciation warnings that don’t concern us on some of the most used types/modules.

The M0235 warning will _not_ be produced unless you set a particular compiler flag, so you will not suddenly get a bunch of deprecation warnings. These will show up in the completion popups right now, but I’ve added an [issue](https://github.com/caffeinelabs/vscode-motoko/issues/421) to hide them in the future.

I’m not sure which breaking changes exactly you’re referring to, but the ones mentioned in the [Changelog](https://github.com/caffeinelabs/motoko-core/blob/main/Changelog.md#200) are definitely beneficial to our regular users of Motoko:

- **Breaking:** `Text.join`, `Float.format` parameter order swap. ← Makes it so you can write `["Hello", "World"].join(" ")` and `(1.234).format(#exact)`
- **Breaking:** Rename `sort` to `sortInPlace`, add `sort` (#405). ← Improves API consistency between the different collection types
