arrow.debug.debug.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arrow-docs Show documentation
Show all versions of arrow-docs Show documentation
Functional companion to Kotlin's Standard Library
package arrow.debug
import arrow.TC
import arrow.data.Try
import arrow.effects.Async
import arrow.effects.Effect
import arrow.effects.MonadSuspend
import arrow.effects.async
import arrow.mtl.*
import arrow.typeclasses.*
import kotlin.reflect.KClass
inline fun debugInstanceLookups(): Map, () -> TC> = mapOf(
Alternative::class to { alternative() },
Applicative::class to { applicative() },
ApplicativeError::class to { applicativeError() },
Bifoldable::class to { bifoldable() },
Bimonad::class to { bimonad() },
Comonad::class to { comonad() },
Eq::class to { eq() },
Foldable::class to { foldable() },
Functor::class to { functor() },
FunctorFilter::class to { functorFilter() },
Monad::class to { monad() },
MonadCombine::class to { monadCombine() },
MonadError::class to { monadError() },
MonadFilter::class to { monadFilter() },
MonadReader::class to { monadReader() },
MonadState::class to { monadState() },
MonadWriter::class to { monadWriter() },
Monoid::class to { monoid() },
MonoidK::class to { monoidK() },
Reducible::class to { reducible() },
Semigroup::class to { semigroup() },
SemigroupK::class to { semigroupK() },
Traverse::class to { traverse() },
TraverseFilter::class to { traverse() },
MonadSuspend::class to { async() },
Async::class to { async() },
Effect::class to { async() }
)
inline fun showInstances(
debugLookupTable: Map, () -> TC> = debugInstanceLookups()): List =
debugLookupTable.entries
.filter { Try { it.value() }.fold({ false }, { true }) }
.map { it.key.simpleName }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy