
Collection of productivity-boosting extensions for common types, operator-based function composition and UI: memoization, numeric and tuple utilities, tree structures, file helpers, rich Compose modifiers/tray APIs.
= Malefic Extensions :toc: :toc-placement: preamble :toclevels: 3 :source-highlighter: highlight.js
Malefic Extensions accelerates Kotlin Multiplatform and Compose projects with a curated toolkit of pragmatic extensions. Ship faster by relying on:
Modifier ergonomics.== Targets & Distribution
[cols="1,2,2", options="header"]
|===
| Artifact | Targets | Notes
| xyz.malefic:extensions | commonMain, androidMain, jvmMain (Desktop), iosX64/Arm64, iosSimulatorArm64, js (browser + node), wasmJs | Single multiplatform bundle that includes core language utilities plus Compose-aware helpers on the targets that support them.
|===
Need a refresher on the code layout? Start with link:extensions/src/commonMain/kotlin/xyz/malefic/extensions[extensions/src/commonMain/...].
== Feature Matrix
[cols="1,3", options="header"]
|===
| Category | Highlights
| any | Nullability helpers and fluent predicates for Any.
| bool | Boolean combinators (ifTrue, ifFalse, guards).
| collection | AccessOrderLinkedHashMap, multiplatform ConcurrentHashMap, and expressive list utilities.
| func | Memoization (Cache), composition operators, safe invocation wrappers, infix DSLs.
| lazy | Lightweight lazy list builder for streamed evaluation.
| modifier | Compose Modifier operators (showIf, roundedBackgroundWithPadding, modifyIfElse, clickableIf).
| num | Infix math DSL, factorial/triangular sequences, prime and gcd utilities.
| tree | TreeNode structure with traversal helpers.
| tuple | Extended tuples (Triple → Decuple) with destructuring support.
| application | Compose Desktop tray/menu helpers (Tray, Item).
| file, stream, string | File-tree builders, stream transformations, and string predicates.
|===
== Installation
Add the single artifact wherever you need it. Replace $version with the desired release (see link:LICENSE[releases] or git tag -l).
=== Multiplatform build.gradle.kts
Compose-aware helpers (tray/menu, Modifier, etc.) live in the same artifact—just add the Compose runtime/foundation dependencies to the targets where you use them.
== Usage
=== Core snippets
// Function composition DSL val increment = { x: Int -> x + 1 } val double = { x: Int -> x * 2 } val pipeline = increment andThen double val composed = pipeline(3) // 8
// Numeric helpers val factorial = 5.factorial() // 120 val triangular = 7.triangular() // 28 val isPrime = 97.isPrime() // true
=== Compose snippets
// Tray + menu setup (Compose Desktop) ApplicationScope.tray { icon = painterResource("icon.png") tooltip = "My Application" onAction = { println("Tray clicked") } menu { Item("Settings") { openSettings() } Item("Exit") { exitApplication() } } }
== Documentation & Support
extensions/src/...]../gradlew dokkaGenerateModuleHtml and published under build/dokka.== Contributing
feature/my-improvement), and keep changes scoped../gradlew build (plus dokkaGenerateModuleHtml if docs change) before opening a PR.== License
Malefic Extensions is distributed under the MIT License. See link:LICENSE[LICENSE] for the full text.
= Malefic Extensions :toc: :toc-placement: preamble :toclevels: 3 :source-highlighter: highlight.js
Malefic Extensions accelerates Kotlin Multiplatform and Compose projects with a curated toolkit of pragmatic extensions. Ship faster by relying on:
Modifier ergonomics.== Targets & Distribution
[cols="1,2,2", options="header"]
|===
| Artifact | Targets | Notes
| xyz.malefic:extensions | commonMain, androidMain, jvmMain (Desktop), iosX64/Arm64, iosSimulatorArm64, js (browser + node), wasmJs | Single multiplatform bundle that includes core language utilities plus Compose-aware helpers on the targets that support them.
|===
Need a refresher on the code layout? Start with link:extensions/src/commonMain/kotlin/xyz/malefic/extensions[extensions/src/commonMain/...].
== Feature Matrix
[cols="1,3", options="header"]
|===
| Category | Highlights
| any | Nullability helpers and fluent predicates for Any.
| bool | Boolean combinators (ifTrue, ifFalse, guards).
| collection | AccessOrderLinkedHashMap, multiplatform ConcurrentHashMap, and expressive list utilities.
| func | Memoization (Cache), composition operators, safe invocation wrappers, infix DSLs.
| lazy | Lightweight lazy list builder for streamed evaluation.
| modifier | Compose Modifier operators (showIf, roundedBackgroundWithPadding, modifyIfElse, clickableIf).
| num | Infix math DSL, factorial/triangular sequences, prime and gcd utilities.
| tree | TreeNode structure with traversal helpers.
| tuple | Extended tuples (Triple → Decuple) with destructuring support.
| application | Compose Desktop tray/menu helpers (Tray, Item).
| file, stream, string | File-tree builders, stream transformations, and string predicates.
|===
== Installation
Add the single artifact wherever you need it. Replace $version with the desired release (see link:LICENSE[releases] or git tag -l).
=== Multiplatform build.gradle.kts
Compose-aware helpers (tray/menu, Modifier, etc.) live in the same artifact—just add the Compose runtime/foundation dependencies to the targets where you use them.
== Usage
=== Core snippets
// Function composition DSL val increment = { x: Int -> x + 1 } val double = { x: Int -> x * 2 } val pipeline = increment andThen double val composed = pipeline(3) // 8
// Numeric helpers val factorial = 5.factorial() // 120 val triangular = 7.triangular() // 28 val isPrime = 97.isPrime() // true
=== Compose snippets
// Tray + menu setup (Compose Desktop) ApplicationScope.tray { icon = painterResource("icon.png") tooltip = "My Application" onAction = { println("Tray clicked") } menu { Item("Settings") { openSettings() } Item("Exit") { exitApplication() } } }
== Documentation & Support
extensions/src/...]../gradlew dokkaGenerateModuleHtml and published under build/dokka.== Contributing
feature/my-improvement), and keep changes scoped../gradlew build (plus dokkaGenerateModuleHtml if docs change) before opening a PR.== License
Malefic Extensions is distributed under the MIT License. See link:LICENSE[LICENSE] for the full text.