diff --git a/compiler-plugin/src/io/github/kyay10/highkt/HighKTRegistrar.kt b/compiler-plugin/src/io/github/kyay10/highkt/HighKTRegistrar.kt index d0d7d93..e5e76e9 100644 --- a/compiler-plugin/src/io/github/kyay10/highkt/HighKTRegistrar.kt +++ b/compiler-plugin/src/io/github/kyay10/highkt/HighKTRegistrar.kt @@ -1,6 +1,8 @@ package io.github.kyay10.highkt import io.github.kyay10.highkt.fir.KindReturnTypeRefiner +import io.github.kyay10.highkt.fir.KindScopeProviderReplacer +import io.github.kyay10.highkt.fir.ReplaceKDispatchReceiversExtension import org.jetbrains.kotlin.fir.extensions.FirExtensionApiInternals import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrar @@ -8,5 +10,7 @@ class HighKTRegistrar : FirExtensionRegistrar() { @OptIn(FirExtensionApiInternals::class) override fun ExtensionRegistrarContext.configurePlugin() { +::KindReturnTypeRefiner + +::KindScopeProviderReplacer + +::ReplaceKDispatchReceiversExtension } } diff --git a/compiler-plugin/src/io/github/kyay10/highkt/fir/KindReturnTypeRefiner.kt b/compiler-plugin/src/io/github/kyay10/highkt/fir/KindReturnTypeRefiner.kt index 3dee24b..119018e 100644 --- a/compiler-plugin/src/io/github/kyay10/highkt/fir/KindReturnTypeRefiner.kt +++ b/compiler-plugin/src/io/github/kyay10/highkt/fir/KindReturnTypeRefiner.kt @@ -80,7 +80,7 @@ class KindReturnTypeRefiner(session: FirSession) : FirExpressionResolutionExtens sessionHolder: SessionAndScopeSessionHolder, containingCallableSymbol: FirBasedSymbol<*>, ): List { - // TODO figure out how to make resolution see the member scopes of K types so that this is unnecessary + // This exists as a fallback in case scope replacement ever breaks functionCall.replaceConeTypeOrNull(functionCall.resolvedType.applyKOrSelf()) return emptyList() } diff --git a/compiler-plugin/src/io/github/kyay10/highkt/fir/KindScopeProviderReplacer.kt b/compiler-plugin/src/io/github/kyay10/highkt/fir/KindScopeProviderReplacer.kt new file mode 100644 index 0000000..741d2c9 --- /dev/null +++ b/compiler-plugin/src/io/github/kyay10/highkt/fir/KindScopeProviderReplacer.kt @@ -0,0 +1,208 @@ +package io.github.kyay10.highkt.fir + +import org.jetbrains.kotlin.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.FirImplementationDetail +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.SessionHolder +import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind +import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.checkers.expression.ExpressionCheckers +import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirQualifiedAccessExpressionChecker +import org.jetbrains.kotlin.fir.analysis.extensions.FirAdditionalCheckersExtension +import org.jetbrains.kotlin.fir.declarations.FirClass +import org.jetbrains.kotlin.fir.declarations.FirDeclaration +import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin +import org.jetbrains.kotlin.fir.declarations.FirResolvePhase +import org.jetbrains.kotlin.fir.declarations.builder.buildRegularClassCopy +import org.jetbrains.kotlin.fir.declarations.utils.classId +import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression +import org.jetbrains.kotlin.fir.extensions.FirStatusTransformerExtension +import org.jetbrains.kotlin.fir.resolve.ScopeSession +import org.jetbrains.kotlin.fir.resolve.ScopeSessionKey +import org.jetbrains.kotlin.fir.resolve.calls.fullyExpandedClass +import org.jetbrains.kotlin.fir.resolve.createSubstitutionForScope +import org.jetbrains.kotlin.fir.resolve.defaultType +import org.jetbrains.kotlin.fir.resolve.fullyExpandedType +import org.jetbrains.kotlin.fir.resolve.substitution.ConeRawScopeSubstitutor +import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor +import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap +import org.jetbrains.kotlin.fir.resolve.toClassSymbol +import org.jetbrains.kotlin.fir.resolve.toSymbol +import org.jetbrains.kotlin.fir.scopes.ConeSubstitutionScopeKey +import org.jetbrains.kotlin.fir.scopes.FirKotlinScopeProvider +import org.jetbrains.kotlin.fir.scopes.FirTypeScope +import org.jetbrains.kotlin.fir.scopes.impl.FirClassSubstitutionScope +import org.jetbrains.kotlin.fir.scopes.kotlinScopeProvider +import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope +import org.jetbrains.kotlin.fir.symbols.SymbolInternals +import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol +import org.jetbrains.kotlin.fir.types.ConeClassLikeLookupTag +import org.jetbrains.kotlin.fir.types.ConeClassLikeType +import org.jetbrains.kotlin.fir.types.lowerBoundIfFlexible +import org.jetbrains.kotlin.fir.types.resolvedType +import org.jetbrains.kotlin.util.PrivateForInline + +class ReplaceKDispatchReceiversExtension(session: FirSession) : FirAdditionalCheckersExtension(session) { + override val expressionCheckers: ExpressionCheckers + get() = + object : ExpressionCheckers() { + override val qualifiedAccessExpressionCheckers: Set + get() = setOf(Checker()) + } + + class Checker : FirQualifiedAccessExpressionChecker(MppCheckerKind.Common) { + context(context: CheckerContext, reporter: DiagnosticReporter) + override fun check(expression: FirQualifiedAccessExpression) { + val receiver = expression.dispatchReceiver ?: return + val type = receiver.resolvedType + val applied = type.applyKOrSelf() + if (applied !== type) receiver.replaceConeTypeOrNull(applied) // TODO might throw error + } + } +} + +@OptIn(FirImplementationDetail::class, SymbolInternals::class, PrivateForInline::class) +class KindScopeProviderReplacer(session: FirSession) : FirStatusTransformerExtension(session), SessionHolder { + private val scopesField = ScopeSession::class.java.getDeclaredField("scopes").apply { isAccessible = true } + var initialized = false + + override fun needTransformStatus(declaration: FirDeclaration): Boolean { + if (!initialized) { + initialized = true + val symbol = K_CLASS_ID.toSymbol() as? FirRegularClassSymbol ?: return false + val originalDecorator = session.kotlinScopeProvider.declaredMemberScopeDecorator + symbol.bind( + buildRegularClassCopy(symbol.fir) { + scopeProvider = + FirKotlinScopeProvider { klass, declaredMemberScope, useSiteSession, scopeSession, memberRequiredPhase -> + try { + scopesField.set( + scopeSession, + ScopeSessionMap(useSiteSession, scopeSession).apply { putAll(scopeSession.scopes()) }, + ) + } catch(_: Exception) { } + originalDecorator(klass, declaredMemberScope, useSiteSession, scopeSession, memberRequiredPhase) + } + this.symbol = symbol + } + ) + } + return false + } +} + +class ScopeSessionMap(val session: FirSession, val scopeSession: ScopeSession) : + HashMap, Any>>() { + override fun containsKey(key: Any) = + super.containsKey(key) || (key is FirClass && key.fullyExpandedClass(session)?.classId == K_CLASS_ID) + + override fun get(key: Any) = + when { + super.containsKey(key) -> super.get(key) + key is FirClass && key.fullyExpandedClass(session)?.classId == K_CLASS_ID -> + ScopeSessionKeyMap(key, session, scopeSession).also { put(key, it) } + else -> null + } +} + +class ScopeSessionKeyMap( + private val kClass: FirClass, + override val session: FirSession, + val scopeSession: ScopeSession, +) : HashMap, Any>(), SessionHolder { + override fun get(key: ScopeSessionKey<*, *>): Any? = + when { + super.containsKey(key) -> super.get(key) + key is ConeSubstitutionScopeKey -> { + val substitutor = key.substitutor + val kType = substitutor.substituteOrSelf(kClass.defaultType()) + val isRaw = substitutor is ConeRawScopeSubstitutor + val applied = kType.applyKOrSelf() + if (applied !is ConeClassLikeType || applied === kType) return super.get(key) + (applied.classScope(session, scopeSession, null, isRaw) ?: return super.get(key)).also { put(key, it) } + } + else -> super.get(key) + } +} + +@OptIn(SymbolInternals::class) +private fun ConeClassLikeType.classScope( + useSiteSession: FirSession, + scopeSession: ScopeSession, + requiredMembersPhase: FirResolvePhase?, + isRaw: Boolean, +): FirTypeScope? { + val fullyExpandedType = fullyExpandedType(useSiteSession) + val fir = fullyExpandedType.lookupTag.toClassSymbol(useSiteSession)?.fir ?: return null + val substitutor = + when { + isRaw -> ConeRawScopeSubstitutor(useSiteSession) + else -> + substitutorByMap( + createSubstitutionForScope(fir.typeParameters, fullyExpandedType, useSiteSession), + useSiteSession, + ) + } + + return fir.scopeForClass(substitutor, useSiteSession, scopeSession, lookupTag, requiredMembersPhase) +} + +fun FirClass.scopeForClass( + substitutor: ConeSubstitutor, + useSiteSession: FirSession, + scopeSession: ScopeSession, + memberOwnerLookupTag: ConeClassLikeLookupTag, + memberRequiredPhase: FirResolvePhase?, +): FirTypeScope = + scopeForClassImpl( + substitutor, + useSiteSession, + scopeSession, + skipPrivateMembers = false, + classFirDispatchReceiver = this, + isFromExpectClass = false, + memberOwnerLookupTag = memberOwnerLookupTag, + memberRequiredPhase = memberRequiredPhase, + ) + +private fun FirClass.scopeForClassImpl( + substitutor: ConeSubstitutor, + useSiteSession: FirSession, + scopeSession: ScopeSession, + skipPrivateMembers: Boolean, + classFirDispatchReceiver: FirClass, + isFromExpectClass: Boolean, + memberOwnerLookupTag: ConeClassLikeLookupTag?, + memberRequiredPhase: FirResolvePhase?, +): FirTypeScope { + val basicScope = + unsubstitutedScope(useSiteSession, scopeSession, withForcedTypeCalculator = false, memberRequiredPhase) + if (substitutor == ConeSubstitutor.Empty) return basicScope + + val key = + ConeSubstitutionScopeKey( + classFirDispatchReceiver.symbol.toLookupTag(), + isFromExpectClass, + substitutor, + memberOwnerLookupTag, + ) + val type = + substitutor.substituteOrSelf(classFirDispatchReceiver.defaultType()).lowerBoundIfFlexible() as ConeClassLikeType + + return FirClassSubstitutionScope( + useSiteSession, + basicScope, + key, + substitutor, + type, + skipPrivateMembers, + makeExpect = isFromExpectClass, + memberOwnerLookupTag ?: classFirDispatchReceiver.symbol.toLookupTag(), + origin = + if (classFirDispatchReceiver != this) { + FirDeclarationOrigin.SubstitutionOverride.DeclarationSite + } else { + FirDeclarationOrigin.SubstitutionOverride.CallSite + }, + ) +} diff --git a/compiler-plugin/src/io/github/kyay10/highkt/ir/RemoveKCastsGenerationExtension.kt b/compiler-plugin/src/io/github/kyay10/highkt/ir/RemoveKCastsGenerationExtension.kt index b33bb40..3bb71d5 100644 --- a/compiler-plugin/src/io/github/kyay10/highkt/ir/RemoveKCastsGenerationExtension.kt +++ b/compiler-plugin/src/io/github/kyay10/highkt/ir/RemoveKCastsGenerationExtension.kt @@ -7,6 +7,8 @@ import org.jetbrains.kotlin.backend.jvm.overrides.IrJavaIncompatibilityRulesOver import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.ir.declarations.IrModuleFragment +import org.jetbrains.kotlin.ir.declarations.IrProperty +import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrTypeOperator import org.jetbrains.kotlin.ir.expressions.IrTypeOperatorCall @@ -18,9 +20,9 @@ import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.IrTypeSystemContextImpl import org.jetbrains.kotlin.ir.types.impl.buildSimpleType import org.jetbrains.kotlin.ir.util.erasedUpperBound -import org.jetbrains.kotlin.ir.util.functions import org.jetbrains.kotlin.ir.util.kotlinFqName import org.jetbrains.kotlin.ir.util.nonDispatchParameters +import org.jetbrains.kotlin.ir.util.propertyIfAccessor import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid import org.jetbrains.kotlin.ir.visitors.IrTypeTransformerVoid import org.jetbrains.kotlin.ir.visitors.IrVisitorVoid @@ -93,7 +95,7 @@ class FixupOverriddenFunctionsVisitor(pluginContext: IrPluginContext) : IrVisito @OptIn(UnsafeDuringIrConstructionAPI::class) override fun visitClass(declaration: IrClass) { - for ((_, functions) in declaration.functions.groupBy { it.name }) { + for ((_, functions) in declaration.allFunctions.groupBy { it.name }) { val fakeOverrides = functions.filter { it.isFakeOverride } val realFunctions = functions.filterNot { it.isFakeOverride } for (realFunction in realFunctions) { @@ -121,7 +123,7 @@ class FixupOverriddenFunctionsVisitor(pluginContext: IrPluginContext) : IrVisito realFunction.overriddenSymbols += fakeOverride.overriddenSymbols parameterTypes = realFunction.nonDispatchParameters.map { it.type } returnType = realFunction.returnType - declaration.declarations.remove(fakeOverride) + declaration.declarations.remove(fakeOverride.propertyIfAccessor) } OverrideCompatibilityInfo.Result.CONFLICT -> Unit @@ -135,3 +137,13 @@ class FixupOverriddenFunctionsVisitor(pluginContext: IrPluginContext) : IrVisito super.visitClass(declaration) } } + +@OptIn(UnsafeDuringIrConstructionAPI::class) +val IrClass.allFunctions: Sequence + get() = declarations.asSequence().flatMap { + when (it) { + is IrSimpleFunction -> listOf(it) + is IrProperty -> listOfNotNull(it.getter, it.setter) + else -> emptyList() + } + } \ No newline at end of file diff --git a/compiler-plugin/testData/box/category.fir.ir.txt b/compiler-plugin/testData/box/category.fir.ir.txt index 43118d5..09bfc45 100644 --- a/compiler-plugin/testData/box/category.fir.ir.txt +++ b/compiler-plugin/testData/box/category.fir.ir.txt @@ -22,14 +22,18 @@ FILE fqName:foo.bar fileName:/category.kt VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.Category VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? VALUE_PARAMETER kind:Regular name:g index:2 type:kotlin.Any? - FUN name:source visibility:public modality:ABSTRACT returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.Category - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - FUN name:target visibility:public modality:ABSTRACT returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.Category - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + PROPERTY name:source visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.Category + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:source visibility:public modality:ABSTRACT [val] + PROPERTY name:target visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.Category + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:target visibility:public modality:ABSTRACT [val] CLASS INTERFACE name:Functor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] thisReceiver: VALUE_PARAMETER INSTANCE_RECEIVER kind:DispatchReceiver name: type:foo.bar.Functor TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -176,10 +180,6 @@ FILE fqName:foo.bar fileName:/category.kt VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:kotlin.Any overridden: public open fun toString (): kotlin.String declared in foo.bar.TensorProduct - FUN name:empty visibility:public modality:ABSTRACT returnType:kotlin.Any? - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.MonoidObject - FUN name:plus visibility:public modality:ABSTRACT returnType:kotlin.Any? - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.MonoidObject PROPERTY FAKE_OVERRIDE name:firstCategory visibility:public modality:ABSTRACT [fake_override,val] overridden: public abstract firstCategory: foo.bar.Category declared in foo.bar.TensorProduct @@ -204,6 +204,14 @@ FILE fqName:foo.bar fileName:/category.kt correspondingProperty: PROPERTY FAKE_OVERRIDE name:unitObject visibility:public modality:ABSTRACT [fake_override,val] overridden: public abstract fun (): kotlin.Any? declared in foo.bar.TensorProduct + PROPERTY name:empty visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT returnType:kotlin.Any? + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.MonoidObject + correspondingProperty: PROPERTY name:empty visibility:public modality:ABSTRACT [val] + PROPERTY name:plus visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT returnType:kotlin.Any? + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.MonoidObject + correspondingProperty: PROPERTY name:plus visibility:public modality:ABSTRACT [val] CLASS INTERFACE name:Nat modality:ABSTRACT visibility:public superTypes:[kotlin.Any] thisReceiver: VALUE_PARAMETER INSTANCE_RECEIVER kind:DispatchReceiver name: type:foo.bar.Nat TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -378,26 +386,30 @@ FILE fqName:foo.bar fileName:/category.kt ARG p1: CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=B of foo.bar.ArrowCategory.compose origin=INVOKE ARG : GET_VAR 'g: kotlin.Any? declared in foo.bar.ArrowCategory.compose' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION ARG p1: GET_VAR 'a: A of foo.bar.ArrowCategory.compose declared in foo.bar.ArrowCategory.compose.' type=A of foo.bar.ArrowCategory.compose origin=null - FUN name:source visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.ArrowCategory - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - overridden: - public abstract fun source (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun source (: kotlin.Any?): kotlin.Any? declared in foo.bar.ArrowCategory' - CALL 'public final fun idArrow (): kotlin.Function1 declared in foo.bar' type=kotlin.Function1 origin=null - TYPE_ARG A: A of foo.bar.ArrowCategory.source - FUN name:target visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.ArrowCategory - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - overridden: - public abstract fun target (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun target (: kotlin.Any?): kotlin.Any? declared in foo.bar.ArrowCategory' - CALL 'public final fun idArrow (): kotlin.Function1 declared in foo.bar' type=kotlin.Function1 origin=null - TYPE_ARG A: A of foo.bar.ArrowCategory.target + PROPERTY name:source visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.ArrowCategory + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:source visibility:public modality:OPEN [val] + overridden: + public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.ArrowCategory' + CALL 'public final fun idArrow (): kotlin.Function1 declared in foo.bar' type=kotlin.Function1, A of foo.bar.ArrowCategory.> origin=null + TYPE_ARG A: A of foo.bar.ArrowCategory. + PROPERTY name:target visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.ArrowCategory + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:target visibility:public modality:OPEN [val] + overridden: + public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.ArrowCategory' + CALL 'public final fun idArrow (): kotlin.Function1 declared in foo.bar' type=kotlin.Function1, A of foo.bar.ArrowCategory.> origin=null + TYPE_ARG A: A of foo.bar.ArrowCategory. FUN name:Iso visibility:private modality:FINAL returnType:foo.bar.Iso TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false TYPE_PARAMETER name:D index:1 variance: superTypes:[kotlin.Any?] reified:false @@ -634,7 +646,7 @@ FILE fqName:foo.bar fileName:/category.kt ARG : CALL 'public abstract fun get (c: kotlin.Any?): kotlin.Any? declared in foo.bar.Nat' type=kotlin.Any? origin=null TYPE_ARG A: B of foo.bar.at ARG : GET_VAR ': foo.bar.Nat declared in foo.bar.at' type=foo.bar.Nat origin=IMPLICIT_ARGUMENT - ARG c: CALL 'public final fun target (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=null + ARG c: CALL 'public final fun (category: foo.bar.Category>, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=GET_PROPERTY TYPE_ARG Cat: C of foo.bar.at TYPE_ARG A: B of foo.bar.at ARG category: GET_VAR '$context-Category#1: foo.bar.Category declared in foo.bar.at.' type=foo.bar.Category origin=null @@ -1627,52 +1639,56 @@ FILE fqName:foo.bar fileName:/category.kt ARG $context-Category: GET_VAR 'cd: foo.bar.Category declared in foo.bar.functorCategory' type=foo.bar.Category origin=null ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.functorCategory..compose' type=foo.bar.Nat.compose, H of foo.bar.functorCategory..compose> origin=null ARG other: GET_VAR 'g: kotlin.Any? declared in foo.bar.functorCategory..compose' type=foo.bar.Nat.compose, G of foo.bar.functorCategory..compose> origin=null - FUN name:source visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.functorCategory. - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - overridden: - public abstract fun source (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun source (: kotlin.Any?): kotlin.Any? declared in foo.bar.functorCategory.' - CALL 'public final fun context (with: T of kotlin.context, block: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1): R of kotlin.context declared in kotlin' type=foo.bar.Iso.source, F of foo.bar.functorCategory..source> origin=null - TYPE_ARG T: foo.bar.Functor.source> - TYPE_ARG R: foo.bar.Iso.source, F of foo.bar.functorCategory..source> - ARG with: CALL 'public abstract fun (): foo.bar.Functor declared in foo.bar.Nat' type=foo.bar.Functor.source> origin=GET_PROPERTY - ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.functorCategory..source' type=foo.bar.Nat.source, *> origin=IMPLICIT_ARGUMENT - ARG block: FUN_EXPR type=kotlin.Function1.source>, foo.bar.Iso.source, F of foo.bar.functorCategory..source>> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:foo.bar.Iso.source, F of foo.bar.functorCategory..source> - VALUE_PARAMETER UNDERSCORE_PARAMETER kind:Context name:$context-Functor index:0 type:foo.bar.Functor.source> - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun ($context-Functor: foo.bar.Functor.source>): foo.bar.Iso.source, F of foo.bar.functorCategory..source> declared in foo.bar.functorCategory..source' - CALL 'public final fun identityNat (functor: foo.bar.Functor): foo.bar.Iso declared in foo.bar' type=foo.bar.Iso.source, F of foo.bar.functorCategory..source> origin=null - TYPE_ARG C: C of foo.bar.functorCategory - TYPE_ARG D: D of foo.bar.functorCategory - TYPE_ARG F: F of foo.bar.functorCategory..source - ARG functor: GET_VAR '$context-Functor: foo.bar.Functor.source> declared in foo.bar.functorCategory..source.' type=foo.bar.Functor.source> origin=null - FUN name:target visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.functorCategory. - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - overridden: - public abstract fun target (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun target (: kotlin.Any?): kotlin.Any? declared in foo.bar.functorCategory.' - CALL 'public final fun context (with: T of kotlin.context, block: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1): R of kotlin.context declared in kotlin' type=foo.bar.Iso.target, F of foo.bar.functorCategory..target> origin=null - TYPE_ARG T: foo.bar.Functor.target> - TYPE_ARG R: foo.bar.Iso.target, F of foo.bar.functorCategory..target> - ARG with: CALL 'public abstract fun (): foo.bar.Functor declared in foo.bar.Nat' type=foo.bar.Functor.target> origin=GET_PROPERTY - ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.functorCategory..target' type=foo.bar.Nat.target> origin=IMPLICIT_ARGUMENT - ARG block: FUN_EXPR type=kotlin.Function1.target>, foo.bar.Iso.target, F of foo.bar.functorCategory..target>> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:foo.bar.Iso.target, F of foo.bar.functorCategory..target> - VALUE_PARAMETER UNDERSCORE_PARAMETER kind:Context name:$context-Functor index:0 type:foo.bar.Functor.target> - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun ($context-Functor: foo.bar.Functor.target>): foo.bar.Iso.target, F of foo.bar.functorCategory..target> declared in foo.bar.functorCategory..target' - CALL 'public final fun identityNat (functor: foo.bar.Functor): foo.bar.Iso declared in foo.bar' type=foo.bar.Iso.target, F of foo.bar.functorCategory..target> origin=null - TYPE_ARG C: C of foo.bar.functorCategory - TYPE_ARG D: D of foo.bar.functorCategory - TYPE_ARG F: F of foo.bar.functorCategory..target - ARG functor: GET_VAR '$context-Functor: foo.bar.Functor.target> declared in foo.bar.functorCategory..target.' type=foo.bar.Functor.target> origin=null + PROPERTY name:source visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.functorCategory. + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:source visibility:public modality:OPEN [val] + overridden: + public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.functorCategory.' + CALL 'public final fun context (with: T of kotlin.context, block: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1): R of kotlin.context declared in kotlin' type=foo.bar.Iso., F of foo.bar.functorCategory..> origin=null + TYPE_ARG T: foo.bar.Functor.> + TYPE_ARG R: foo.bar.Iso., F of foo.bar.functorCategory..> + ARG with: CALL 'public abstract fun (): foo.bar.Functor declared in foo.bar.Nat' type=foo.bar.Functor.> origin=GET_PROPERTY + ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.functorCategory..' type=foo.bar.Nat., *> origin=IMPLICIT_ARGUMENT + ARG block: FUN_EXPR type=kotlin.Function1.>, foo.bar.Iso., F of foo.bar.functorCategory..>> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:foo.bar.Iso., F of foo.bar.functorCategory..> + VALUE_PARAMETER UNDERSCORE_PARAMETER kind:Context name:$context-Functor index:0 type:foo.bar.Functor.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun ($context-Functor: foo.bar.Functor.>): foo.bar.Iso., F of foo.bar.functorCategory..> declared in foo.bar.functorCategory..' + CALL 'public final fun identityNat (functor: foo.bar.Functor): foo.bar.Iso declared in foo.bar' type=foo.bar.Iso., F of foo.bar.functorCategory..> origin=null + TYPE_ARG C: C of foo.bar.functorCategory + TYPE_ARG D: D of foo.bar.functorCategory + TYPE_ARG F: F of foo.bar.functorCategory.. + ARG functor: GET_VAR '$context-Functor: foo.bar.Functor.> declared in foo.bar.functorCategory...' type=foo.bar.Functor.> origin=null + PROPERTY name:target visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:F index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.functorCategory. + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:target visibility:public modality:OPEN [val] + overridden: + public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.functorCategory.' + CALL 'public final fun context (with: T of kotlin.context, block: @[ContextFunctionTypeParams(count = 1)] kotlin.Function1): R of kotlin.context declared in kotlin' type=foo.bar.Iso., F of foo.bar.functorCategory..> origin=null + TYPE_ARG T: foo.bar.Functor.> + TYPE_ARG R: foo.bar.Iso., F of foo.bar.functorCategory..> + ARG with: CALL 'public abstract fun (): foo.bar.Functor declared in foo.bar.Nat' type=foo.bar.Functor.> origin=GET_PROPERTY + ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.functorCategory..' type=foo.bar.Nat.> origin=IMPLICIT_ARGUMENT + ARG block: FUN_EXPR type=kotlin.Function1.>, foo.bar.Iso., F of foo.bar.functorCategory..>> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:foo.bar.Iso., F of foo.bar.functorCategory..> + VALUE_PARAMETER UNDERSCORE_PARAMETER kind:Context name:$context-Functor index:0 type:foo.bar.Functor.> + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun ($context-Functor: foo.bar.Functor.>): foo.bar.Iso., F of foo.bar.functorCategory..> declared in foo.bar.functorCategory..' + CALL 'public final fun identityNat (functor: foo.bar.Functor): foo.bar.Iso declared in foo.bar' type=foo.bar.Iso., F of foo.bar.functorCategory..> origin=null + TYPE_ARG C: C of foo.bar.functorCategory + TYPE_ARG D: D of foo.bar.functorCategory + TYPE_ARG F: F of foo.bar.functorCategory.. + ARG functor: GET_VAR '$context-Functor: foo.bar.Functor.> declared in foo.bar.functorCategory...' type=foo.bar.Functor.> origin=null CONSTRUCTOR_CALL 'public constructor () declared in foo.bar.functorCategory.' type=foo.bar.functorCategory. origin=OBJECT_LITERAL FUN name:functorComposeFunctor visibility:public modality:FINAL returnType:foo.bar.Functor> TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -2136,32 +2152,52 @@ FILE fqName:foo.bar fileName:/category.kt ARG category: GET_VAR 'c: foo.bar.Category declared in foo.bar.oppositeCategory' type=foo.bar.Category origin=null ARG : GET_VAR 'g: kotlin.Any? declared in foo.bar.oppositeCategory..compose' type=kotlin.Any? origin=null ARG g: GET_VAR '(index:1): kotlin.Any? declared in foo.bar.oppositeCategory..compose' type=kotlin.Any? origin=null - FUN name:source visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.oppositeCategory. - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - overridden: - public abstract fun source (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun source (: kotlin.Any?): kotlin.Any? declared in foo.bar.oppositeCategory.' - CALL 'public final fun target (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=null - TYPE_ARG Cat: Cat of foo.bar.oppositeCategory - TYPE_ARG A: A of foo.bar.oppositeCategory..source - ARG category: GET_VAR 'c: foo.bar.Category declared in foo.bar.oppositeCategory' type=foo.bar.Category origin=null - ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.oppositeCategory..source' type=kotlin.Any? origin=IMPLICIT_ARGUMENT - FUN name:target visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.oppositeCategory. - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - overridden: - public abstract fun target (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun target (: kotlin.Any?): kotlin.Any? declared in foo.bar.oppositeCategory.' - CALL 'public final fun source (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=null - TYPE_ARG Cat: Cat of foo.bar.oppositeCategory - TYPE_ARG A: A of foo.bar.oppositeCategory..target - ARG category: GET_VAR 'c: foo.bar.Category declared in foo.bar.oppositeCategory' type=foo.bar.Category origin=null - ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.oppositeCategory..target' type=kotlin.Any? origin=IMPLICIT_ARGUMENT + PROPERTY name:source visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.oppositeCategory. + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:source visibility:public modality:OPEN [val] + overridden: + public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.oppositeCategory.' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Any? origin=null + TYPE_ARG T: foo.bar.Category + TYPE_ARG R: kotlin.Any? + ARG receiver: GET_VAR 'c: foo.bar.Category declared in foo.bar.oppositeCategory' type=foo.bar.Category origin=null + ARG block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1, kotlin.Any?> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Any? + VALUE_PARAMETER kind:ExtensionReceiver name:$this$with index:0 type:foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun ($this$with: foo.bar.Category): kotlin.Any? declared in foo.bar.oppositeCategory..' + CALL 'public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category' type=kotlin.Any? origin=GET_PROPERTY + TYPE_ARG A: A of foo.bar.oppositeCategory.. + ARG (index:0): GET_VAR '$this$with: foo.bar.Category declared in foo.bar.oppositeCategory...' type=foo.bar.Category origin=IMPLICIT_ARGUMENT + ARG (index:1): GET_VAR '(index:1): kotlin.Any? declared in foo.bar.oppositeCategory..' type=kotlin.Any? origin=null + PROPERTY name:target visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.oppositeCategory. + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:target visibility:public modality:OPEN [val] + overridden: + public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.oppositeCategory.' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Any? origin=null + TYPE_ARG T: foo.bar.Category + TYPE_ARG R: kotlin.Any? + ARG receiver: GET_VAR 'c: foo.bar.Category declared in foo.bar.oppositeCategory' type=foo.bar.Category origin=null + ARG block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1, kotlin.Any?> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Any? + VALUE_PARAMETER kind:ExtensionReceiver name:$this$with index:0 type:foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun ($this$with: foo.bar.Category): kotlin.Any? declared in foo.bar.oppositeCategory..' + CALL 'public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category' type=kotlin.Any? origin=GET_PROPERTY + TYPE_ARG A: A of foo.bar.oppositeCategory.. + ARG (index:0): GET_VAR '$this$with: foo.bar.Category declared in foo.bar.oppositeCategory...' type=foo.bar.Category origin=IMPLICIT_ARGUMENT + ARG (index:1): GET_VAR '(index:1): kotlin.Any? declared in foo.bar.oppositeCategory..' type=kotlin.Any? origin=null CONSTRUCTOR_CALL 'public constructor () declared in foo.bar.oppositeCategory.' type=foo.bar.oppositeCategory. origin=OBJECT_LITERAL FUN name:productCategory visibility:public modality:FINAL returnType:foo.bar.Category TYPE_PARAMETER name:C1 index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -2224,93 +2260,57 @@ FILE fqName:foo.bar fileName:/category.kt ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..compose' type=kotlin.Pair origin=IMPLICIT_ARGUMENT ARG g: CALL 'public final fun (): B of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY ARG : GET_VAR 'g: kotlin.Any? declared in foo.bar.productCategory..compose' type=kotlin.Pair origin=null - FUN name:source visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.productCategory. - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - overridden: - public abstract fun source (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun source

(: kotlin.Any?): kotlin.Any? declared in foo.bar.productCategory.' - CALL 'public final fun to (: A of kotlin.to, that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null - TYPE_ARG A: kotlin.Any? - TYPE_ARG B: kotlin.Any? - ARG : CALL 'public final fun source (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=null - TYPE_ARG Cat: C1 of foo.bar.productCategory - TYPE_ARG A: kotlin.Any? - ARG category: GET_VAR '$context-Category#1: foo.bar.Category declared in foo.bar.productCategory' type=foo.bar.Category origin=null - ARG : CALL 'public final fun (): A of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY - ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..source' type=kotlin.Pair origin=IMPLICIT_ARGUMENT - ARG that: CALL 'public final fun source (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=null - TYPE_ARG Cat: C2 of foo.bar.productCategory - TYPE_ARG A: kotlin.Any? - ARG category: GET_VAR '$context-Category#2: foo.bar.Category declared in foo.bar.productCategory' type=foo.bar.Category origin=null - ARG : CALL 'public final fun (): B of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY - ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..source' type=kotlin.Pair origin=IMPLICIT_ARGUMENT - FUN name:target visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.productCategory. - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - overridden: - public abstract fun target (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun target

(: kotlin.Any?): kotlin.Any? declared in foo.bar.productCategory.' - CALL 'public final fun to (: A of kotlin.to, that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null - TYPE_ARG A: kotlin.Any? - TYPE_ARG B: kotlin.Any? - ARG : CALL 'public final fun target (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=null - TYPE_ARG Cat: C1 of foo.bar.productCategory + PROPERTY name:source visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.productCategory. + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:source visibility:public modality:OPEN [val] + overridden: + public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun

(: kotlin.Any?): kotlin.Any? declared in foo.bar.productCategory.' + CALL 'public final fun to (: A of kotlin.to, that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null TYPE_ARG A: kotlin.Any? - ARG category: GET_VAR '$context-Category#1: foo.bar.Category declared in foo.bar.productCategory' type=foo.bar.Category origin=null - ARG : CALL 'public final fun (): A of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY - ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..target' type=kotlin.Pair origin=IMPLICIT_ARGUMENT - ARG that: CALL 'public final fun target (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=null - TYPE_ARG Cat: C2 of foo.bar.productCategory + TYPE_ARG B: kotlin.Any? + ARG : CALL 'public final fun (category: foo.bar.Category>, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=GET_PROPERTY + TYPE_ARG Cat: C1 of foo.bar.productCategory + TYPE_ARG A: kotlin.Any? + ARG category: GET_VAR '$context-Category#1: foo.bar.Category declared in foo.bar.productCategory' type=foo.bar.Category origin=null + ARG : CALL 'public final fun (): A of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY + ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..' type=kotlin.Pair origin=IMPLICIT_ARGUMENT + ARG that: CALL 'public final fun (category: foo.bar.Category>, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=GET_PROPERTY + TYPE_ARG Cat: C2 of foo.bar.productCategory + TYPE_ARG A: kotlin.Any? + ARG category: GET_VAR '$context-Category#2: foo.bar.Category declared in foo.bar.productCategory' type=foo.bar.Category origin=null + ARG : CALL 'public final fun (): B of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY + ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..' type=kotlin.Pair origin=IMPLICIT_ARGUMENT + PROPERTY name:target visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.productCategory. + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:target visibility:public modality:OPEN [val] + overridden: + public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun

(: kotlin.Any?): kotlin.Any? declared in foo.bar.productCategory.' + CALL 'public final fun to (: A of kotlin.to, that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null TYPE_ARG A: kotlin.Any? - ARG category: GET_VAR '$context-Category#2: foo.bar.Category declared in foo.bar.productCategory' type=foo.bar.Category origin=null - ARG : CALL 'public final fun (): B of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY - ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..target' type=kotlin.Pair origin=IMPLICIT_ARGUMENT + TYPE_ARG B: kotlin.Any? + ARG : CALL 'public final fun (category: foo.bar.Category>, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=GET_PROPERTY + TYPE_ARG Cat: C1 of foo.bar.productCategory + TYPE_ARG A: kotlin.Any? + ARG category: GET_VAR '$context-Category#1: foo.bar.Category declared in foo.bar.productCategory' type=foo.bar.Category origin=null + ARG : CALL 'public final fun (): A of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY + ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..' type=kotlin.Pair origin=IMPLICIT_ARGUMENT + ARG that: CALL 'public final fun (category: foo.bar.Category>, : kotlin.Any?): kotlin.Any? declared in foo.bar' type=kotlin.Any? origin=GET_PROPERTY + TYPE_ARG Cat: C2 of foo.bar.productCategory + TYPE_ARG A: kotlin.Any? + ARG category: GET_VAR '$context-Category#2: foo.bar.Category declared in foo.bar.productCategory' type=foo.bar.Category origin=null + ARG : CALL 'public final fun (): B of kotlin.Pair declared in kotlin.Pair' type=kotlin.Any? origin=GET_PROPERTY + ARG : GET_VAR '(index:1): kotlin.Any? declared in foo.bar.productCategory..' type=kotlin.Pair origin=IMPLICIT_ARGUMENT CONSTRUCTOR_CALL 'public constructor () declared in foo.bar.productCategory.' type=foo.bar.productCategory. origin=OBJECT_LITERAL - FUN name:source visibility:public modality:FINAL returnType:kotlin.Any? - TYPE_PARAMETER name:Cat index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:A index:1 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:Context name:category index:0 type:foo.bar.Category - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun source (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Any? origin=null - TYPE_ARG T: foo.bar.Category - TYPE_ARG R: kotlin.Any? - ARG receiver: GET_VAR 'category: foo.bar.Category declared in foo.bar.source' type=foo.bar.Category origin=null - ARG block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Any? - VALUE_PARAMETER kind:ExtensionReceiver name:$this$with index:0 type:foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun ($this$with: foo.bar.Category): kotlin.Any? declared in foo.bar.source' - CALL 'public abstract fun source (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.source - ARG (index:0): GET_VAR '$this$with: foo.bar.Category declared in foo.bar.source.' type=foo.bar.Category origin=IMPLICIT_ARGUMENT - ARG (index:1): GET_VAR ': kotlin.Any? declared in foo.bar.source' type=kotlin.Any? origin=null - FUN name:target visibility:public modality:FINAL returnType:kotlin.Any? - TYPE_PARAMETER name:Cat index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:A index:1 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:Context name:category index:0 type:foo.bar.Category - VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun target (category: foo.bar.Category, : kotlin.Any?): kotlin.Any? declared in foo.bar' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Any? origin=null - TYPE_ARG T: foo.bar.Category - TYPE_ARG R: kotlin.Any? - ARG receiver: GET_VAR 'category: foo.bar.Category declared in foo.bar.target' type=foo.bar.Category origin=null - ARG block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Any? - VALUE_PARAMETER kind:ExtensionReceiver name:$this$with index:0 type:foo.bar.Category - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun ($this$with: foo.bar.Category): kotlin.Any? declared in foo.bar.target' - CALL 'public abstract fun target (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.target - ARG (index:0): GET_VAR '$this$with: foo.bar.Category declared in foo.bar.target.' type=foo.bar.Category origin=IMPLICIT_ARGUMENT - ARG (index:1): GET_VAR ': kotlin.Any? declared in foo.bar.target' type=kotlin.Any? origin=null FUN name:toNormalFunctor visibility:public modality:FINAL returnType:foo.bar.Functor>, io.github.kyay10.highkt.Constructor>, M of foo.bar.toNormalFunctor> TYPE_PARAMETER name:M index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER kind:ExtensionReceiver name: index:0 type:foo.bar.UsualMonad @@ -2424,148 +2424,11 @@ FILE fqName:foo.bar fileName:/category.kt CALL 'public final fun endoFunctorComposeTensor (k: foo.bar.Category): foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> declared in foo.bar' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null TYPE_ARG Cat: io.github.kyay10.highkt.Constructor> ARG k: GET_VAR '$context-ArrowCategory: foo.bar.ArrowCategory declared in foo.bar.toNormalMonad.' type=foo.bar.ArrowCategory origin=null - CONSTRUCTOR visibility:public returnType:foo.bar.toNormalMonad.. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[foo.bar.MonoidObject, io.github.kyay10.highkt.Identity, M of foo.bar.toNormalMonad>; foo.bar.TensorProduct, io.github.kyay10.highkt.Identity>]' type=kotlin.Unit - FUN DELEGATED_MEMBER name:associator visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:C index:2 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. - VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? - VALUE_PARAMETER kind:Regular name:b index:2 type:kotlin.Any? - VALUE_PARAMETER kind:Regular name:c index:3 type:kotlin.Any? - overridden: - public abstract fun associator (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject - public abstract fun associator (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun associator (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' - CALL 'public abstract fun associator (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.toNormalMonad...associator - TYPE_ARG B: B of foo.bar.toNormalMonad...associator - TYPE_ARG C: C of foo.bar.toNormalMonad...associator - ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null - receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...associator' type=foo.bar.toNormalMonad.. origin=null - ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...associator' type=kotlin.Any? origin=null - ARG b: GET_VAR 'b: kotlin.Any? declared in foo.bar.toNormalMonad...associator' type=kotlin.Any? origin=null - ARG c: GET_VAR 'c: kotlin.Any? declared in foo.bar.toNormalMonad...associator' type=kotlin.Any? origin=null - FUN DELEGATED_MEMBER name:associatorInv visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:C index:2 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. - VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? - VALUE_PARAMETER kind:Regular name:b index:2 type:kotlin.Any? - VALUE_PARAMETER kind:Regular name:c index:3 type:kotlin.Any? - overridden: - public abstract fun associatorInv (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject - public abstract fun associatorInv (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun associatorInv (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' - CALL 'public abstract fun associatorInv (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.toNormalMonad...associatorInv - TYPE_ARG B: B of foo.bar.toNormalMonad...associatorInv - TYPE_ARG C: C of foo.bar.toNormalMonad...associatorInv - ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null - receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...associatorInv' type=foo.bar.toNormalMonad.. origin=null - ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...associatorInv' type=kotlin.Any? origin=null - ARG b: GET_VAR 'b: kotlin.Any? declared in foo.bar.toNormalMonad...associatorInv' type=kotlin.Any? origin=null - ARG c: GET_VAR 'c: kotlin.Any? declared in foo.bar.toNormalMonad...associatorInv' type=kotlin.Any? origin=null - FUN DELEGATED_MEMBER name:leftUnitor visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. - VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? - overridden: - public abstract fun leftUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject - public abstract fun leftUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun leftUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' - CALL 'public abstract fun leftUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.toNormalMonad...leftUnitor - ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null - receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...leftUnitor' type=foo.bar.toNormalMonad.. origin=null - ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...leftUnitor' type=kotlin.Any? origin=null - FUN DELEGATED_MEMBER name:leftUnitorInv visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. - VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? - overridden: - public abstract fun leftUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject - public abstract fun leftUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun leftUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' - CALL 'public abstract fun leftUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.toNormalMonad...leftUnitorInv - ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null - receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...leftUnitorInv' type=foo.bar.toNormalMonad.. origin=null - ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...leftUnitorInv' type=kotlin.Any? origin=null - FUN DELEGATED_MEMBER name:lift visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. - VALUE_PARAMETER kind:Regular name:f index:1 type:kotlin.Any? - overridden: - public abstract fun lift (f: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject - public abstract fun lift (f: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun lift (f: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' - CALL 'public abstract fun lift (f: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.toNormalMonad...lift - TYPE_ARG B: B of foo.bar.toNormalMonad...lift - ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null - receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...lift' type=foo.bar.toNormalMonad.. origin=null - ARG f: GET_VAR 'f: kotlin.Any? declared in foo.bar.toNormalMonad...lift' type=kotlin.Any? origin=null - FUN DELEGATED_MEMBER name:rightUnitor visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. - VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? - overridden: - public abstract fun rightUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject - public abstract fun rightUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun rightUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' - CALL 'public abstract fun rightUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.toNormalMonad...rightUnitor - ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null - receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...rightUnitor' type=foo.bar.toNormalMonad.. origin=null - ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...rightUnitor' type=kotlin.Any? origin=null - FUN DELEGATED_MEMBER name:rightUnitorInv visibility:public modality:OPEN returnType:kotlin.Any? - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. - VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? - overridden: - public abstract fun rightUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject - public abstract fun rightUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun rightUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' - CALL 'public abstract fun rightUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null - TYPE_ARG A: A of foo.bar.toNormalMonad...rightUnitorInv - ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null - receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...rightUnitorInv' type=foo.bar.toNormalMonad.. origin=null - ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...rightUnitorInv' type=kotlin.Any? origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN returnType:kotlin.Boolean [fake_override,operator] - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:kotlin.Any - VALUE_PARAMETER kind:Regular name:other index:1 type:kotlin.Any? + PROPERTY name:empty visibility:public modality:OPEN [val] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in foo.bar.MonoidObject - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in foo.bar.TensorProduct - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN returnType:kotlin.Int [fake_override] - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:kotlin.Any - overridden: - public open fun hashCode (): kotlin.Int declared in foo.bar.MonoidObject - public open fun hashCode (): kotlin.Int declared in foo.bar.TensorProduct - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN returnType:kotlin.String [fake_override] - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:kotlin.Any - overridden: - public open fun toString (): kotlin.String declared in foo.bar.MonoidObject - public open fun toString (): kotlin.String declared in foo.bar.TensorProduct - FUN name:empty visibility:public modality:OPEN returnType:foo.bar.toNormalMonad...empty. - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. - overridden: - public abstract fun empty (): kotlin.Any? declared in foo.bar.MonoidObject - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun empty (): foo.bar.toNormalMonad...empty. declared in foo.bar.toNormalMonad..' + public abstract empty: kotlin.Any? declared in foo.bar.MonoidObject + FIELD PROPERTY_BACKING_FIELD name:empty type:foo.bar.toNormalMonad...empty. visibility:private [final] + EXPRESSION_BODY BLOCK type=foo.bar.toNormalMonad...empty. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[foo.bar.Nat>, io.github.kyay10.highkt.Constructor>, io.github.kyay10.highkt.Identity, M of foo.bar.toNormalMonad>] thisReceiver: VALUE_PARAMETER INSTANCE_RECEIVER kind:DispatchReceiver name: type:foo.bar.toNormalMonad...empty. @@ -2638,12 +2501,20 @@ FILE fqName:foo.bar fileName:/category.kt ARG : GET_VAR ': foo.bar.UsualMonad declared in foo.bar.toNormalMonad' type=foo.bar.UsualMonad origin=IMPLICIT_ARGUMENT ARG a: GET_VAR 'a: A of foo.bar.toNormalMonad...empty..get declared in foo.bar.toNormalMonad...empty..get.' type=A of foo.bar.toNormalMonad...empty..get origin=null CONSTRUCTOR_CALL 'public constructor () declared in foo.bar.toNormalMonad...empty.' type=foo.bar.toNormalMonad...empty. origin=OBJECT_LITERAL - FUN name:plus visibility:public modality:OPEN returnType:foo.bar.toNormalMonad...plus. - VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN returnType:foo.bar.toNormalMonad...empty. + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + correspondingProperty: PROPERTY name:empty visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Any? declared in foo.bar.MonoidObject + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): foo.bar.toNormalMonad...empty. declared in foo.bar.toNormalMonad..' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:empty type:foo.bar.toNormalMonad...empty. visibility:private [final]' type=foo.bar.toNormalMonad...empty. origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...' type=foo.bar.toNormalMonad.. origin=null + PROPERTY name:plus visibility:public modality:OPEN [val] overridden: - public abstract fun plus (): kotlin.Any? declared in foo.bar.MonoidObject - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun plus (): foo.bar.toNormalMonad...plus. declared in foo.bar.toNormalMonad..' + public abstract plus: kotlin.Any? declared in foo.bar.MonoidObject + FIELD PROPERTY_BACKING_FIELD name:plus type:foo.bar.toNormalMonad...plus. visibility:private [final] + EXPRESSION_BODY BLOCK type=foo.bar.toNormalMonad...plus. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[foo.bar.Nat>, io.github.kyay10.highkt.Constructor>, kotlin.Any?, M of foo.bar.toNormalMonad>] thisReceiver: VALUE_PARAMETER INSTANCE_RECEIVER kind:DispatchReceiver name: type:foo.bar.toNormalMonad...plus. @@ -2728,6 +2599,151 @@ FILE fqName:foo.bar fileName:/category.kt RETURN type=kotlin.Nothing from='local final fun (ma: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad...plus..get.' GET_VAR 'ma: kotlin.Any? declared in foo.bar.toNormalMonad...plus..get..' type=kotlin.Any? origin=null CONSTRUCTOR_CALL 'public constructor () declared in foo.bar.toNormalMonad...plus.' type=foo.bar.toNormalMonad...plus. origin=OBJECT_LITERAL + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN returnType:foo.bar.toNormalMonad...plus. + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + correspondingProperty: PROPERTY name:plus visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Any? declared in foo.bar.MonoidObject + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): foo.bar.toNormalMonad...plus. declared in foo.bar.toNormalMonad..' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:plus type:foo.bar.toNormalMonad...plus. visibility:private [final]' type=foo.bar.toNormalMonad...plus. origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...' type=foo.bar.toNormalMonad.. origin=null + CONSTRUCTOR visibility:public returnType:foo.bar.toNormalMonad.. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[foo.bar.MonoidObject, io.github.kyay10.highkt.Identity, M of foo.bar.toNormalMonad>; foo.bar.TensorProduct, io.github.kyay10.highkt.Identity>]' type=kotlin.Unit + FUN DELEGATED_MEMBER name:associator visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:C index:2 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? + VALUE_PARAMETER kind:Regular name:b index:2 type:kotlin.Any? + VALUE_PARAMETER kind:Regular name:c index:3 type:kotlin.Any? + overridden: + public abstract fun associator (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject + public abstract fun associator (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun associator (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' + CALL 'public abstract fun associator (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null + TYPE_ARG A: A of foo.bar.toNormalMonad...associator + TYPE_ARG B: B of foo.bar.toNormalMonad...associator + TYPE_ARG C: C of foo.bar.toNormalMonad...associator + ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...associator' type=foo.bar.toNormalMonad.. origin=null + ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...associator' type=kotlin.Any? origin=null + ARG b: GET_VAR 'b: kotlin.Any? declared in foo.bar.toNormalMonad...associator' type=kotlin.Any? origin=null + ARG c: GET_VAR 'c: kotlin.Any? declared in foo.bar.toNormalMonad...associator' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:associatorInv visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:C index:2 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? + VALUE_PARAMETER kind:Regular name:b index:2 type:kotlin.Any? + VALUE_PARAMETER kind:Regular name:c index:3 type:kotlin.Any? + overridden: + public abstract fun associatorInv (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject + public abstract fun associatorInv (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun associatorInv (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' + CALL 'public abstract fun associatorInv (a: kotlin.Any?, b: kotlin.Any?, c: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null + TYPE_ARG A: A of foo.bar.toNormalMonad...associatorInv + TYPE_ARG B: B of foo.bar.toNormalMonad...associatorInv + TYPE_ARG C: C of foo.bar.toNormalMonad...associatorInv + ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...associatorInv' type=foo.bar.toNormalMonad.. origin=null + ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...associatorInv' type=kotlin.Any? origin=null + ARG b: GET_VAR 'b: kotlin.Any? declared in foo.bar.toNormalMonad...associatorInv' type=kotlin.Any? origin=null + ARG c: GET_VAR 'c: kotlin.Any? declared in foo.bar.toNormalMonad...associatorInv' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:leftUnitor visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? + overridden: + public abstract fun leftUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject + public abstract fun leftUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun leftUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' + CALL 'public abstract fun leftUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null + TYPE_ARG A: A of foo.bar.toNormalMonad...leftUnitor + ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...leftUnitor' type=foo.bar.toNormalMonad.. origin=null + ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...leftUnitor' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:leftUnitorInv visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? + overridden: + public abstract fun leftUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject + public abstract fun leftUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun leftUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' + CALL 'public abstract fun leftUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null + TYPE_ARG A: A of foo.bar.toNormalMonad...leftUnitorInv + ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...leftUnitorInv' type=foo.bar.toNormalMonad.. origin=null + ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...leftUnitorInv' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:lift visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + VALUE_PARAMETER kind:Regular name:f index:1 type:kotlin.Any? + overridden: + public abstract fun lift (f: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject + public abstract fun lift (f: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun lift (f: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' + CALL 'public abstract fun lift (f: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null + TYPE_ARG A: A of foo.bar.toNormalMonad...lift + TYPE_ARG B: B of foo.bar.toNormalMonad...lift + ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...lift' type=foo.bar.toNormalMonad.. origin=null + ARG f: GET_VAR 'f: kotlin.Any? declared in foo.bar.toNormalMonad...lift' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:rightUnitor visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? + overridden: + public abstract fun rightUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject + public abstract fun rightUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun rightUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' + CALL 'public abstract fun rightUnitor (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null + TYPE_ARG A: A of foo.bar.toNormalMonad...rightUnitor + ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...rightUnitor' type=foo.bar.toNormalMonad.. origin=null + ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...rightUnitor' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:rightUnitorInv visibility:public modality:OPEN returnType:kotlin.Any? + TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:foo.bar.toNormalMonad.. + VALUE_PARAMETER kind:Regular name:a index:1 type:kotlin.Any? + overridden: + public abstract fun rightUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.MonoidObject + public abstract fun rightUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun rightUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.toNormalMonad..' + CALL 'public abstract fun rightUnitorInv (a: kotlin.Any?): kotlin.Any? declared in foo.bar.TensorProduct' type=kotlin.Any? origin=null + TYPE_ARG A: A of foo.bar.toNormalMonad...rightUnitorInv + ARG : GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> visibility:private [final] declared in foo.bar.toNormalMonad..' type=foo.bar.TensorProduct, io.github.kyay10.highkt.Identity> origin=null + receiver: GET_VAR ': foo.bar.toNormalMonad.. declared in foo.bar.toNormalMonad...rightUnitorInv' type=foo.bar.toNormalMonad.. origin=null + ARG a: GET_VAR 'a: kotlin.Any? declared in foo.bar.toNormalMonad...rightUnitorInv' type=kotlin.Any? origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN returnType:kotlin.Boolean [fake_override,operator] + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:kotlin.Any + VALUE_PARAMETER kind:Regular name:other index:1 type:kotlin.Any? + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in foo.bar.MonoidObject + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in foo.bar.TensorProduct + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN returnType:kotlin.Int [fake_override] + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:kotlin.Any + overridden: + public open fun hashCode (): kotlin.Int declared in foo.bar.MonoidObject + public open fun hashCode (): kotlin.Int declared in foo.bar.TensorProduct + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN returnType:kotlin.String [fake_override] + VALUE_PARAMETER kind:DispatchReceiver name: index:0 type:kotlin.Any + overridden: + public open fun toString (): kotlin.String declared in foo.bar.MonoidObject + public open fun toString (): kotlin.String declared in foo.bar.TensorProduct PROPERTY DELEGATED_MEMBER name:firstCategory visibility:public modality:OPEN [val] overridden: public abstract firstCategory: foo.bar.Category declared in foo.bar.MonoidObject @@ -2813,7 +2829,7 @@ FILE fqName:foo.bar fileName:/category.kt TYPE_ARG T: foo.bar.Functor>, io.github.kyay10.highkt.Constructor>, M of foo.bar.toUsualMonad> TYPE_ARG R: kotlin.Any? ARG with: CALL 'public abstract fun (): foo.bar.Functor declared in foo.bar.Nat' type=foo.bar.Functor>, io.github.kyay10.highkt.Constructor>, M of foo.bar.toUsualMonad> origin=GET_PROPERTY - ARG : CALL 'public abstract fun plus (): kotlin.Any? declared in foo.bar.MonoidObject' type=foo.bar.Nat>, io.github.kyay10.highkt.Constructor>, kotlin.Any?, M of foo.bar.toUsualMonad> origin=null + ARG : CALL 'public abstract fun (): kotlin.Any? declared in foo.bar.MonoidObject' type=foo.bar.Nat>, io.github.kyay10.highkt.Constructor>, kotlin.Any?, M of foo.bar.toUsualMonad> origin=GET_PROPERTY ARG : GET_VAR ': foo.bar.MonoidObject, io.github.kyay10.highkt.Identity, M of foo.bar.toUsualMonad> declared in foo.bar.toUsualMonad' type=foo.bar.MonoidObject, io.github.kyay10.highkt.Identity, M of foo.bar.toUsualMonad> origin=IMPLICIT_ARGUMENT ARG block: FUN_EXPR type=kotlin.Function1>, io.github.kyay10.highkt.Constructor>, M of foo.bar.toUsualMonad>, kotlin.Any?> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Any? @@ -2834,7 +2850,7 @@ FILE fqName:foo.bar fileName:/category.kt CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Any? origin=INVOKE ARG : CALL 'public abstract fun get (c: kotlin.Any?): kotlin.Any? declared in foo.bar.Nat' type=kotlin.Function1 origin=GET_ARRAY_ELEMENT TYPE_ARG A: B of foo.bar.toUsualMonad..bind - ARG : CALL 'public abstract fun plus (): kotlin.Any? declared in foo.bar.MonoidObject' type=foo.bar.Nat>, io.github.kyay10.highkt.Constructor>, kotlin.Any?, M of foo.bar.toUsualMonad> origin=null + ARG : CALL 'public abstract fun (): kotlin.Any? declared in foo.bar.MonoidObject' type=foo.bar.Nat>, io.github.kyay10.highkt.Constructor>, kotlin.Any?, M of foo.bar.toUsualMonad> origin=GET_PROPERTY ARG : GET_VAR ': foo.bar.MonoidObject, io.github.kyay10.highkt.Identity, M of foo.bar.toUsualMonad> declared in foo.bar.toUsualMonad' type=foo.bar.MonoidObject, io.github.kyay10.highkt.Identity, M of foo.bar.toUsualMonad> origin=IMPLICIT_ARGUMENT ARG c: CALL 'public final fun idArrow (): kotlin.Function1 declared in foo.bar' type=kotlin.Function1.bind, B of foo.bar.toUsualMonad..bind> origin=null TYPE_ARG A: B of foo.bar.toUsualMonad..bind @@ -2850,7 +2866,7 @@ FILE fqName:foo.bar fileName:/category.kt CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 declared in kotlin.Function1' type=kotlin.Any? origin=INVOKE ARG : CALL 'public abstract fun get (c: kotlin.Any?): kotlin.Any? declared in foo.bar.Nat' type=kotlin.Function1 origin=GET_ARRAY_ELEMENT TYPE_ARG A: A of foo.bar.toUsualMonad..pure - ARG : CALL 'public abstract fun empty (): kotlin.Any? declared in foo.bar.MonoidObject' type=foo.bar.Nat>, io.github.kyay10.highkt.Constructor>, io.github.kyay10.highkt.Identity, M of foo.bar.toUsualMonad> origin=null + ARG : CALL 'public abstract fun (): kotlin.Any? declared in foo.bar.MonoidObject' type=foo.bar.Nat>, io.github.kyay10.highkt.Constructor>, io.github.kyay10.highkt.Identity, M of foo.bar.toUsualMonad> origin=GET_PROPERTY ARG : GET_VAR ': foo.bar.MonoidObject, io.github.kyay10.highkt.Identity, M of foo.bar.toUsualMonad> declared in foo.bar.toUsualMonad' type=foo.bar.MonoidObject, io.github.kyay10.highkt.Identity, M of foo.bar.toUsualMonad> origin=IMPLICIT_ARGUMENT ARG c: CALL 'public final fun idArrow (): kotlin.Function1 declared in foo.bar' type=kotlin.Function1.pure, A of foo.bar.toUsualMonad..pure> origin=null TYPE_ARG A: A of foo.bar.toUsualMonad..pure @@ -2942,6 +2958,50 @@ FILE fqName:foo.bar fileName:/category.kt ARG : GET_VAR 'other: foo.bar.Nat declared in foo.bar.vertical' type=foo.bar.Nat origin=null ARG c: GET_VAR 'c: kotlin.Any? declared in foo.bar.vertical..get' type=kotlin.Any? origin=null CONSTRUCTOR_CALL 'public constructor () declared in foo.bar.vertical.' type=foo.bar.vertical. origin=OBJECT_LITERAL + PROPERTY name:source visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL returnType:kotlin.Any? + TYPE_PARAMETER name:Cat index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:A index:1 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:Context name:category index:0 type:foo.bar.Category> + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:source visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (category: foo.bar.Category>, : kotlin.Any?): kotlin.Any? declared in foo.bar' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Any? origin=null + TYPE_ARG T: foo.bar.Category> + TYPE_ARG R: kotlin.Any? + ARG receiver: GET_VAR 'category: foo.bar.Category> declared in foo.bar.' type=foo.bar.Category> origin=null + ARG block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1>, kotlin.Any?> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Any? + VALUE_PARAMETER kind:ExtensionReceiver name:$this$with index:0 type:foo.bar.Category> + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun ($this$with: foo.bar.Category>): kotlin.Any? declared in foo.bar.' + CALL 'public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category' type=kotlin.Any? origin=GET_PROPERTY + TYPE_ARG A: A of foo.bar. + ARG (index:0): GET_VAR '$this$with: foo.bar.Category> declared in foo.bar..' type=foo.bar.Category> origin=IMPLICIT_ARGUMENT + ARG (index:1): GET_VAR ': kotlin.Any? declared in foo.bar.' type=kotlin.Any? origin=null + PROPERTY name:target visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL returnType:kotlin.Any? + TYPE_PARAMETER name:Cat index:0 variance: superTypes:[kotlin.Any?] reified:false + TYPE_PARAMETER name:A index:1 variance: superTypes:[kotlin.Any?] reified:false + VALUE_PARAMETER kind:Context name:category index:0 type:foo.bar.Category> + VALUE_PARAMETER kind:ExtensionReceiver name: index:1 type:kotlin.Any? + correspondingProperty: PROPERTY name:target visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (category: foo.bar.Category>, : kotlin.Any?): kotlin.Any? declared in foo.bar' + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with declared in kotlin' type=kotlin.Any? origin=null + TYPE_ARG T: foo.bar.Category> + TYPE_ARG R: kotlin.Any? + ARG receiver: GET_VAR 'category: foo.bar.Category> declared in foo.bar.' type=foo.bar.Category> origin=null + ARG block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1>, kotlin.Any?> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Any? + VALUE_PARAMETER kind:ExtensionReceiver name:$this$with index:0 type:foo.bar.Category> + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun ($this$with: foo.bar.Category>): kotlin.Any? declared in foo.bar.' + CALL 'public abstract fun (: kotlin.Any?): kotlin.Any? declared in foo.bar.Category' type=kotlin.Any? origin=GET_PROPERTY + TYPE_ARG A: A of foo.bar. + ARG (index:0): GET_VAR '$this$with: foo.bar.Category> declared in foo.bar..' type=foo.bar.Category> origin=IMPLICIT_ARGUMENT + ARG (index:1): GET_VAR ': kotlin.Any? declared in foo.bar.' type=kotlin.Any? origin=null TYPEALIAS name:Arrow visibility:public expandedType:io.github.kyay10.highkt.Constructor> TYPEALIAS name:BiFunctor visibility:public expandedType:foo.bar.Functor TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] reified:false diff --git a/compiler-plugin/testData/box/category.fir.txt b/compiler-plugin/testData/box/category.fir.txt index 062a310..104f1f3 100644 --- a/compiler-plugin/testData/box/category.fir.txt +++ b/compiler-plugin/testData/box/category.fir.txt @@ -5,9 +5,11 @@ FILE: category.kt public abstract interface Category : R|kotlin/Any| { public abstract infix fun R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, C>|.compose(g: R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, B>|): R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, C>| - public abstract fun R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, *>|.source(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| + public abstract val R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, *>|.source: R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| + public get(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| - public abstract fun R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>|.target(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| + public abstract val R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>|.target: R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| + public get(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| } context(category: R|foo/bar/Category|) @@ -18,19 +20,21 @@ FILE: category.kt ) } context(category: R|foo/bar/Category|) - public final fun R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, *>|.source(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { - ^source R|kotlin/with||, R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>|>(R|/category|, = with@fun R|foo/bar/Category|.(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { - ^ (this@R|special/anonymous|, this@R|foo/bar/source|).R|SubstitutionOverride=} io/github/kyay10/highkt/K, A>|>|() + public final val R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, *>|.source: R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| + public get(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { + ^ R|kotlin/with||, R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>|>(R|/category|, = with@fun R|foo/bar/Category|.(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { + ^ (this@R|special/anonymous|, this@R|foo/bar/source|).R|SubstitutionOverride=} io/github/kyay10/highkt/K, A>|>| + } + ) } - ) - } context(category: R|foo/bar/Category|) - public final fun R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>|.target(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { - ^target R|kotlin/with||, R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>|>(R|/category|, = with@fun R|foo/bar/Category|.(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { - ^ (this@R|special/anonymous|, this@R|foo/bar/target|).R|SubstitutionOverride=} io/github/kyay10/highkt/K, A>|>|() + public final val R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>|.target: R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| + public get(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { + ^ R|kotlin/with||, R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>|>(R|/category|, = with@fun R|foo/bar/Category|.(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { + ^ (this@R|special/anonymous|, this@R|foo/bar/target|).R|SubstitutionOverride=} io/github/kyay10/highkt/K, A>|>| + } + ) } - ) - } public final typealias Opposite = R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>| public final typealias Opp = R|io/github/kyay10/highkt/K>, Arr>| context(c: R|foo/bar/Category|) @@ -44,13 +48,21 @@ FILE: category.kt ^compose context(R|/c|) R|/g|.R|foo/bar/compose|(this@R|foo/bar/.compose|) } - public open override fun R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>|.source(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { - ^source context(R|/c|) this@R|foo/bar/.source|.R|foo/bar/target|() - } + public open override val R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>|.source: R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| + public get(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { + ^ R|kotlin/with||, R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>|>(R|/c|, = with@fun R|foo/bar/Category|.(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { + ^ (this@R|special/anonymous|, this@R|foo/bar/.source|).R|SubstitutionOverride=} io/github/kyay10/highkt/K, A>|>| + } + ) + } - public open override fun R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, *>|.target(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { - ^target context(R|/c|) this@R|foo/bar/.target|.R|foo/bar/source|() - } + public open override val R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, *>|.target: R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| + public get(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { + ^ R|kotlin/with||, R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>|>(R|/c|, = with@fun R|foo/bar/Category|.(): R|{foo/bar/Obj=} io/github/kyay10/highkt/K, A>| { + ^ (this@R|special/anonymous|, this@R|foo/bar/.target|).R|SubstitutionOverride=} io/github/kyay10/highkt/K, A>|>| + } + ) + } } @@ -74,13 +86,15 @@ FILE: category.kt } - public open override fun R|(A) -> *|.source(): R|(A) -> A| { - ^source R|foo/bar/idArrow|() - } + public open override val R|(A) -> *|.source: R|(A) -> A| + public get(): R|(A) -> A| { + ^ R|foo/bar/idArrow|() + } - public open override fun R|(*) -> A|.target(): R|(A) -> A| { - ^target R|foo/bar/idArrow|() - } + public open override val R|(*) -> A|.target: R|(A) -> A| + public get(): R|(A) -> A| { + ^ R|foo/bar/idArrow|() + } } public final typealias TypePaired = R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, B>| @@ -102,13 +116,15 @@ FILE: category.kt ^compose context(R|/|) this@R|foo/bar/.compose|.R|SubstitutionOverride, foo/bar/TypePairFirst>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst>|>|.R|foo/bar/compose|=} io/github/kyay10/highkt/K>>|, R|{foo/bar/TypePairFirst=} io/github/kyay10/highkt/K>>|, R|{foo/bar/TypePairFirst=} io/github/kyay10/highkt/K>>|>(R|/g|.R|SubstitutionOverride, foo/bar/TypePairFirst>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst>|>|).R|kotlin/to|=} io/github/kyay10/highkt/K>>, {foo/bar/TypePairFirst=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst=} io/github/kyay10/highkt/K>>>|, R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K>>, {foo/bar/TypePairSecond=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond=} io/github/kyay10/highkt/K>>>|>(context(R|/|) this@R|foo/bar/.compose|.R|SubstitutionOverride, foo/bar/TypePairSecond>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond>|>|.R|foo/bar/compose|=} io/github/kyay10/highkt/K>>|, R|{foo/bar/TypePairSecond=} io/github/kyay10/highkt/K>>|, R|{foo/bar/TypePairSecond=} io/github/kyay10/highkt/K>>|>(R|/g|.R|SubstitutionOverride, foo/bar/TypePairSecond>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond>|>|)) } - public open override fun

R|{foo/bar/MorphismProduct=} kotlin/Pair<{io/github/kyay10/highkt/K2, foo/bar/TypePairFirst<*>>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst<*>>, {io/github/kyay10/highkt/K2, foo/bar/TypePairSecond<*>>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond<*>>>|.source(): R|kotlin/Pair<{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>, {foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>>| { - ^source context(R|/|) this@R|foo/bar/.source|.R|SubstitutionOverride, foo/bar/TypePairFirst<*>>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst<*>>|>|.R|foo/bar/source|=} io/github/kyay10/highkt/K>>|>().R|kotlin/to|=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>|, R|{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>|>(context(R|/|) this@R|foo/bar/.source|.R|SubstitutionOverride, foo/bar/TypePairSecond<*>>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond<*>>|>|.R|foo/bar/source|=} io/github/kyay10/highkt/K>>|>()) - } + public open override val

R|{foo/bar/MorphismProduct=} kotlin/Pair<{io/github/kyay10/highkt/K2, foo/bar/TypePairFirst<*>>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst<*>>, {io/github/kyay10/highkt/K2, foo/bar/TypePairSecond<*>>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond<*>>>|.source: R|kotlin/Pair<{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>, {foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>>| + public get(): R|kotlin/Pair<{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>, {foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>>| { + ^ context(R|/|) this@R|foo/bar/.source|.R|SubstitutionOverride, foo/bar/TypePairFirst<*>>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst<*>>|>|.R|foo/bar/source|=} io/github/kyay10/highkt/K>>|>.R|kotlin/to|=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>|, R|{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>|>(context(R|/|) this@R|foo/bar/.source|.R|SubstitutionOverride, foo/bar/TypePairSecond<*>>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond<*>>|>|.R|foo/bar/source|=} io/github/kyay10/highkt/K>>|>) + } - public open override fun

R|{foo/bar/MorphismProduct=} kotlin/Pair<{io/github/kyay10/highkt/K2, foo/bar/TypePairFirst

>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst

>, {io/github/kyay10/highkt/K2, foo/bar/TypePairSecond

>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond

>>|.target(): R|kotlin/Pair<{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>, {foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>>| { - ^target context(R|/|) this@R|foo/bar/.target|.R|SubstitutionOverride, foo/bar/TypePairFirst

>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst

>|>|.R|foo/bar/target|=} io/github/kyay10/highkt/K>>|>().R|kotlin/to|=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>|, R|{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>|>(context(R|/|) this@R|foo/bar/.target|.R|SubstitutionOverride, foo/bar/TypePairSecond

>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond

>|>|.R|foo/bar/target|=} io/github/kyay10/highkt/K>>|>()) - } + public open override val

R|{foo/bar/MorphismProduct=} kotlin/Pair<{io/github/kyay10/highkt/K2, foo/bar/TypePairFirst

>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst

>, {io/github/kyay10/highkt/K2, foo/bar/TypePairSecond

>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond

>>|.target: R|kotlin/Pair<{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>, {foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>>| + public get(): R|kotlin/Pair<{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>, {foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>>| { + ^ context(R|/|) this@R|foo/bar/.target|.R|SubstitutionOverride, foo/bar/TypePairFirst

>=} io/github/kyay10/highkt/K>, foo/bar/TypePairFirst

>|>|.R|foo/bar/target|=} io/github/kyay10/highkt/K>>|>.R|kotlin/to|=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairFirst

=} io/github/kyay10/highkt/K>>>|, R|{foo/bar/Obj=} io/github/kyay10/highkt/K>>>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>>>, {foo/bar/TypePairSecond

=} io/github/kyay10/highkt/K>>>|>(context(R|/|) this@R|foo/bar/.target|.R|SubstitutionOverride, foo/bar/TypePairSecond

>=} io/github/kyay10/highkt/K>, foo/bar/TypePairSecond

>|>|.R|foo/bar/target|=} io/github/kyay10/highkt/K>>|>) + } } @@ -188,7 +204,7 @@ FILE: category.kt public final typealias NatK = R|{io/github/kyay10/highkt/K2>, C, D>=} io/github/kyay10/highkt/K>, C>, D>| public final fun R|foo/bar/Nat|.at(h: R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, B>|): R|{io/github/kyay10/highkt/K2, io/github/kyay10/highkt/K>=} io/github/kyay10/highkt/K>, io/github/kyay10/highkt/K>| { ^at R|kotlin/context||, R|foo/bar/Category|, R|foo/bar/Category|, R|{io/github/kyay10/highkt/K2, io/github/kyay10/highkt/K>=} io/github/kyay10/highkt/K>, io/github/kyay10/highkt/K>|>(this@R|foo/bar/at|.R|SubstitutionOverride|>|, this@R|foo/bar/at|.R|SubstitutionOverride|>|.R|SubstitutionOverride|>|, this@R|foo/bar/at|.R|SubstitutionOverride|>|.R|SubstitutionOverride|>|, = context(: R|foo/bar/Functor|, : R|foo/bar/Category|, : R|foo/bar/Category|) context@fun (): R|{io/github/kyay10/highkt/K2, io/github/kyay10/highkt/K>=} io/github/kyay10/highkt/K>, io/github/kyay10/highkt/K>| { - ^ context(R|/|) this@R|foo/bar/at|.R|SubstitutionOverride=} io/github/kyay10/highkt/K>, io/github/kyay10/highkt/K>|>|(context(R|/|) R|/h|.R|foo/bar/target|()).R|foo/bar/compose||, R|io/github/kyay10/highkt/K|, R|io/github/kyay10/highkt/K|>(context(R|/|) R|foo/bar/lift|(R|/h|)) + ^ context(R|/|) this@R|foo/bar/at|.R|SubstitutionOverride=} io/github/kyay10/highkt/K>, io/github/kyay10/highkt/K>|>|(context(R|/|) R|/h|.R|foo/bar/target|).R|foo/bar/compose||, R|io/github/kyay10/highkt/K|, R|io/github/kyay10/highkt/K|>(context(R|/|) R|foo/bar/lift|(R|/h|)) } ) } @@ -305,19 +321,21 @@ FILE: category.kt ^compose context(R|/cd|) this@R|foo/bar/.compose|.R|foo/bar/vertical|(R|/g|) } - public open override fun R|foo/bar/Nat|.source(): R|foo/bar/Iso| { - ^source R|kotlin/context||, R|foo/bar/Iso|>(this@R|foo/bar/.source|.R|SubstitutionOverride|>|, = context(: R|foo/bar/Functor|) context@fun (): R|foo/bar/Iso| { - ^ context(R|/|) R|foo/bar/identityNat|() + public open override val R|foo/bar/Nat|.source: R|foo/bar/Iso| + public get(): R|foo/bar/Iso| { + ^ R|kotlin/context||, R|foo/bar/Iso|>(this@R|foo/bar/.source|.R|SubstitutionOverride|>|, = context(: R|foo/bar/Functor|) context@fun (): R|foo/bar/Iso| { + ^ context(R|/|) R|foo/bar/identityNat|() + } + ) } - ) - } - public open override fun R|foo/bar/Nat|.target(): R|foo/bar/Iso| { - ^target R|kotlin/context||, R|foo/bar/Iso|>(this@R|foo/bar/.target|.R|SubstitutionOverride|>|, = context(: R|foo/bar/Functor|) context@fun (): R|foo/bar/Iso| { - ^ context(R|/|) R|foo/bar/identityNat|() + public open override val R|foo/bar/Nat|.target: R|foo/bar/Iso| + public get(): R|foo/bar/Iso| { + ^ R|kotlin/context||, R|foo/bar/Iso|>(this@R|foo/bar/.target|.R|SubstitutionOverride|>|, = context(: R|foo/bar/Functor|) context@fun (): R|foo/bar/Iso| { + ^ context(R|/|) R|foo/bar/identityNat|() + } + ) } - ) - } } @@ -533,9 +551,11 @@ FILE: category.kt } public abstract interface MonoidObject : R|foo/bar/TensorProduct| { - public abstract fun empty(): R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>| + public abstract val empty: R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>| + public get(): R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K, A>| - public abstract fun plus(): R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K>, A>, A>>, A>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, A>, A>>>, A>| + public abstract val plus: R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K>, A>, A>>, A>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, A>, A>>>, A>| + public get(): R|{io/github/kyay10/highkt/K2=} io/github/kyay10/highkt/K>, A>, A>>, A>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, A>, A>>>, A>| } public final typealias Monad = R|foo/bar/MonoidObject, foo/bar/FunctorComposeK, io/github/kyay10/highkt/Identity, F>| @@ -553,13 +573,13 @@ FILE: category.kt } public open override fun pure(a: R|A|): R|io/github/kyay10/highkt/K| { - ^pure this@R|foo/bar/toUsualMonad|.R|SubstitutionOverride, io/github/kyay10/highkt/Identity, M>=} io/github/kyay10/highkt/K, io/github/kyay10/highkt/Identity>, M>|>|().R|SubstitutionOverride=} io/github/kyay10/highkt/K>, io/github/kyay10/highkt/K>|>|(R|foo/bar/idArrow|()).R|SubstitutionOverride|>|(R|/a|) + ^pure this@R|foo/bar/toUsualMonad|.R|SubstitutionOverride, io/github/kyay10/highkt/Identity, M>=} io/github/kyay10/highkt/K, io/github/kyay10/highkt/Identity>, M>|>|.R|SubstitutionOverride=} io/github/kyay10/highkt/K>, io/github/kyay10/highkt/K>|>|(R|foo/bar/idArrow|()).R|SubstitutionOverride|>|(R|/a|) } public open override fun R|io/github/kyay10/highkt/K|.bind(f: R|(A) -> io/github/kyay10/highkt/K|): R|io/github/kyay10/highkt/K| { - ^bind R|kotlin/context||, R|io/github/kyay10/highkt/K|>(this@R|foo/bar/toUsualMonad|.R|SubstitutionOverride, io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>, M>=} io/github/kyay10/highkt/K, io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>>, M>|>|().R|SubstitutionOverride|>|, = context(: R|foo/bar/Functor|) context@fun (): R|io/github/kyay10/highkt/K| { + ^bind R|kotlin/context||, R|io/github/kyay10/highkt/K|>(this@R|foo/bar/toUsualMonad|.R|SubstitutionOverride, io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>, M>=} io/github/kyay10/highkt/K, io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>>, M>|>|.R|SubstitutionOverride|>|, = context(: R|foo/bar/Functor|) context@fun (): R|io/github/kyay10/highkt/K| { lval mapped: R|io/github/kyay10/highkt/K>| = context(R|/|) R|foo/bar/lift| *>|, R|{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>|, R|M|, R|A|, R|io/github/kyay10/highkt/K|>(R|/f|).R|SubstitutionOverride>|>|(this@R|foo/bar/.bind|) - ^ this@R|foo/bar/toUsualMonad|.R|SubstitutionOverride, io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>, M>=} io/github/kyay10/highkt/K, io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>>, M>|>|().R|SubstitutionOverride=} io/github/kyay10/highkt/K>, M>, M>>, M, A>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>, A>>, io/github/kyay10/highkt/K>|>|(R|foo/bar/idArrow|()).R|SubstitutionOverride|>|(R|/mapped|) + ^ this@R|foo/bar/toUsualMonad|.R|SubstitutionOverride, io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>, M>=} io/github/kyay10/highkt/K, io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>>, M>|>|.R|SubstitutionOverride=} io/github/kyay10/highkt/K>, M>, M>>, M, A>=} io/github/kyay10/highkt/K=} io/github/kyay10/highkt/K>, M>, M>>, A>>, io/github/kyay10/highkt/K>|>|(R|foo/bar/idArrow|()).R|SubstitutionOverride|>|(R|/mapped|) } ) } @@ -601,55 +621,53 @@ FILE: category.kt private final field $$delegate_0: R|foo/bar/TensorProduct, foo/bar/FunctorComposeK, io/github/kyay10/highkt/Identity>| = context(R|/|) R|foo/bar/endoFunctorComposeTensor| *>|>() - public open override fun empty(): R|foo/bar/| { - ^empty object : R|foo/bar/Nat| { - private constructor(): R|foo/bar/| { - super() - } + public open override val empty: R|foo/bar/| = object : R|foo/bar/Nat| { + private constructor(): R|foo/bar/| { + super() + } - public open override val firstFunctor: R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, io/github/kyay10/highkt/Identity>| = context(R|/|) R|foo/bar/identityFunctor| *>|>() - public get(): R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, io/github/kyay10/highkt/Identity>| + public open override val firstFunctor: R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, io/github/kyay10/highkt/Identity>| = context(R|/|) R|foo/bar/identityFunctor| *>|>() + public get(): R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, io/github/kyay10/highkt/Identity>| - public open override val secondFunctor: R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>| = context(R|/|) R|kotlin/contextOf| *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>|>() - public get(): R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>| - - public open override operator fun get(c: R|(A) -> A|): R|(A) -> io/github/kyay10/highkt/K| { - ^get context@fun (a: R|A|): R|io/github/kyay10/highkt/K| { - ^ this@R|foo/bar/toNormalMonad|.R|SubstitutionOverride|>|(R|/a|) - } + public open override val secondFunctor: R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>| = context(R|/|) R|kotlin/contextOf| *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>|>() + public get(): R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>| + public open override operator fun get(c: R|(A) -> A|): R|(A) -> io/github/kyay10/highkt/K| { + ^get fun (a: R|A|): R|io/github/kyay10/highkt/K| { + ^ this@R|foo/bar/toNormalMonad|.R|SubstitutionOverride|>|(R|/a|) } } } - public open override fun plus(): R|foo/bar/| { - ^plus object : R|foo/bar/Nat, M>| { - private constructor(): R|foo/bar/| { - super() - } + public get(): R|foo/bar/| - public open override val firstFunctor: R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Compose=} io/github/kyay10/highkt/K>, M>, M>>| = context(R|/|, R|/|) R|foo/bar/composeFunctors| *>|, R|{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>|, R|{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>|, R|M|, R|M|>() - public get(): R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Compose=} io/github/kyay10/highkt/K>, M>, M>>| + public open override val plus: R|foo/bar/| = object : R|foo/bar/Nat, M>| { + private constructor(): R|foo/bar/| { + super() + } - public open override val secondFunctor: R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>| = context(R|/|) R|kotlin/contextOf| *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>|>() - public get(): R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>| + public open override val firstFunctor: R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Compose=} io/github/kyay10/highkt/K>, M>, M>>| = context(R|/|, R|/|) R|foo/bar/composeFunctors| *>|, R|{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>|, R|{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>|, R|M|, R|M|>() + public get(): R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Compose=} io/github/kyay10/highkt/K>, M>, M>>| - public open override operator fun get(c: R|(A) -> A|): R|(io/github/kyay10/highkt/K>) -> io/github/kyay10/highkt/K| { - ^get context@fun (mma: R|io/github/kyay10/highkt/K>|): R|io/github/kyay10/highkt/K| { - ^ (this@R|foo/bar/toNormalMonad|, R|/mma|).R|SubstitutionOverride|>||, R|A|>( = bind@fun (ma: R|io/github/kyay10/highkt/K|): R|io/github/kyay10/highkt/K| { - ^ R|/ma| - } - ) - } + public open override val secondFunctor: R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>| = context(R|/|) R|kotlin/contextOf| *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>|>() + public get(): R|foo/bar/Functor<{foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, {foo/bar/Arrow=} io/github/kyay10/highkt/Constructor<(*) -> *>, M>| + public open override operator fun get(c: R|(A) -> A|): R|(io/github/kyay10/highkt/K>) -> io/github/kyay10/highkt/K| { + ^get fun (mma: R|io/github/kyay10/highkt/K>|): R|io/github/kyay10/highkt/K| { + ^ (this@R|foo/bar/toNormalMonad|, R|/mma|).R|SubstitutionOverride|>||, R|A|>( = bind@fun (ma: R|io/github/kyay10/highkt/K|): R|io/github/kyay10/highkt/K| { + ^ R|/ma| + } + ) } } } + public get(): R|foo/bar/| + } } diff --git a/compiler-plugin/testData/box/category.kt b/compiler-plugin/testData/box/category.kt index a30a82f..efc1f39 100644 --- a/compiler-plugin/testData/box/category.kt +++ b/compiler-plugin/testData/box/category.kt @@ -10,18 +10,18 @@ typealias Obj = K2 interface Category { infix fun K2.compose(g: K2): K2 - fun K2.source(): Obj - fun K2.target(): Obj + val K2.source: Obj + val K2.target: Obj } context(category: Category) infix fun K2.compose(g: K2) = with(category) { this@compose.compose(g) } context(category: Category) -fun K2.source() = with(category) { this@source.source() } +val K2.source get() = with(category) { this@source.source } context(category: Category) -fun K2.target() = with(category) { this@target.target() } +val K2.target get() = with(category) { this@target.target } typealias Opposite = K2 typealias Opp = K>, Arr> @@ -29,8 +29,8 @@ typealias Opp = K>, Arr> context(c: Category) fun oppositeCategory(): Category> = object : Category> { override fun K2.compose(g: K2) = g compose this - override fun K2.source() = target() - override fun K2.target() = source() + override val K2.source get() = with(c) { this@source.target } + override val K2.target get() = with(c) { this@target.source } } typealias Arrow = Constructor> @@ -40,8 +40,8 @@ fun idArrow() = { a: A -> a } object ArrowCategory : Category { override fun ((B) -> C).compose(g: (A) -> B) = { a: A -> this(g(a)) } - override fun Function1.source() = idArrow() - override fun Function1<*, A>.target() = idArrow() + override val Function1.source get() = idArrow() + override val Function1<*, A>.target get() = idArrow() } typealias TypePaired = K2 @@ -61,9 +61,9 @@ fun productCategory(): Category> = object : Category MorphismProduct.compose(g: MorphismProduct) = first.compose(g.first) to second.compose(g.second) - override fun

MorphismProduct.source() = first.source() to second.source() + override val

MorphismProduct.source get() = first.source to second.source - override fun

MorphismProduct.target() = first.target() to second.target() + override val

MorphismProduct.target get() = first.target to second.target } interface Functor { @@ -106,7 +106,7 @@ typealias NatK = K2>, C, D> fun Nat.at(h: K2) = context(firstFunctor, firstFunctor.firstCategory, firstFunctor.secondCategory) { - get(h.target()) compose lift(h) + get(h.target) compose lift(h) } typealias Endo = Nat @@ -164,8 +164,8 @@ context(cd: Category) fun functorCategory(): Category> = object : Category> { override fun Nat.compose(g: Nat) = this vertical g - override fun Nat.source() = context(firstFunctor) { identityNat() } - override fun Nat.target() = context(secondFunctor) { identityNat() } + override val Nat.source get() = context(firstFunctor) { identityNat() } + override val Nat.target get() = context(secondFunctor) { identityNat() } } typealias FunctorCompose

= Compose, TypePairSecond

> @@ -277,8 +277,8 @@ fun endoFunctorComposeTensor(): TensorProduct, FunctorComposeK, } interface MonoidObject : TensorProduct { - fun empty(): K2 - fun plus(): K2>, A> + val empty: K2 + val plus: K2>, A> } typealias Monad = MonoidObject, FunctorComposeK, Identity, F> @@ -290,10 +290,10 @@ interface UsualMonad { } fun NormalMonad.toUsualMonad(): UsualMonad = object : UsualMonad { - override fun pure(a: A) = empty()[idArrow()](a) - override fun K.bind(f: (A) -> K) = context(plus().secondFunctor) { + override fun pure(a: A) = empty[idArrow()](a) + override fun K.bind(f: (A) -> K) = context(plus.secondFunctor) { val mapped = lift(f)(this) - plus()[idArrow()](mapped) + plus[idArrow()](mapped) } } @@ -306,13 +306,13 @@ fun UsualMonad.toNormalFunctor(): Functor = object : Fun fun UsualMonad.toNormalMonad(): NormalMonad = context(toNormalFunctor(), ArrowCategory) { object : NormalMonad, TensorProduct, FunctorComposeK, Identity> by endoFunctorComposeTensor() { - override fun empty() = object : Nat { + override val empty = object : Nat { override val firstFunctor = identityFunctor() override val secondFunctor = contextOf>() override fun get(c: (A) -> A) = { a: A -> pure(a) } } - override fun plus() = object : Nat, M> { + override val plus = object : Nat, M> { override val firstFunctor = composeFunctors() override val secondFunctor = contextOf>() override fun get(c: (A) -> A) = { mma: K> -> mma.bind { ma -> ma } }