From 9f9dea49ac67012860cd83bc88d524a7ee966020 Mon Sep 17 00:00:00 2001 From: Viktor Lovgren Date: Sun, 22 Oct 2023 12:17:23 +0200 Subject: [PATCH] Add ConfigValue#evalFlatMap alias --- modules/core/shared/src/main/scala/ciris/ConfigValue.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/core/shared/src/main/scala/ciris/ConfigValue.scala b/modules/core/shared/src/main/scala/ciris/ConfigValue.scala index 24fd2b1a..2c50073e 100644 --- a/modules/core/shared/src/main/scala/ciris/ConfigValue.scala +++ b/modules/core/shared/src/main/scala/ciris/ConfigValue.scala @@ -131,6 +131,12 @@ sealed abstract class ConfigValue[+F[_], A] { case loaded @ Loaded(_, _, _) => loaded } + /** + * Alias for `evalMap(f).flatten`. + */ + final def evalFlatMap[G[x] >: F[x], B](f: A => G[ConfigValue[G, B]]): ConfigValue[G, B] = + evalMap(f).flatten + /** * Returns a new [[ConfigValue]] which applies the * specified effectful function on the value.