nw-fp-kotlin
SolidKotlin language-specific patterns with Arrow, Raise DSL, and coroutine-based effects
AI & Automation 526 stars
55 forks Updated 1 weeks ago MIT
Install
Quality Score: 95/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# FP in Kotlin -- Functional Software Crafter Skill
Cross-references: [fp-principles](../nw-fp-principles/SKILL.md) | [fp-domain-modeling](../nw-fp-domain-modeling/SKILL.md) | [pbt-jvm](../nw-pbt-jvm/SKILL.md)
## When to Choose Kotlin
- Best for: gentlest FP onboarding for Java teams | Android | coroutines | pragmatic FP with great IDE support
- Not ideal for: teams wanting compiler-enforced purity | full effect systems | higher-kinded type abstractions
## [STARTER] Quick Setup
```bash
mkdir order-service && cd order-service
gradle init --type kotlin-application --dsl kotlin
# Add arrow-core, arrow-fx-coroutines, kotest-property to build.gradle.kts
./gradlew build && ./gradlew test
```
## [STARTER] Type System for Domain Modeling
### Choice Types (Sealed Hierarchies)
```kotlin
sealed interface PaymentMethod {
data class CreditCard(val cardNumber: String, val expiryDate: String) : PaymentMethod
data class BankTransfer(val accountNumber: String) : PaymentMethod
data object Cash : PaymentMethod
}
```
Exhaustive `when` expressions ensure all cases handled.
### Record Types and Domain Wrappers
```kotlin
data class Customer(
val customerId: CustomerId,
val customerName: CustomerName,
val customerEmail: EmailAddress
)
@JvmInline
value class OrderId(val value: Int)
@JvmInline
value class EmailAddress private constructor(val value: String) {
companion object {
fun from(raw: String): Either<ValidationError, EmailAddress> =
if...
Details
- Author
- nWave-ai
- Repository
- nWave-ai/nWave
- Created
- 3 months ago
- Last Updated
- 1 weeks ago
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Solid
nw-fp-fsharp
F# language-specific patterns, Railway-Oriented Programming, and Computation Expressions
526 Updated 1 weeks ago
nWave-ai AI & Automation Solid
nw-fp-haskell
Haskell language-specific patterns, GADTs, type classes, and effect systems
526 Updated 1 weeks ago
nWave-ai AI & Automation Solid
nw-fp-scala
Scala 3 language-specific patterns with ZIO, Cats Effect, and opaque types
526 Updated 1 weeks ago
nWave-ai AI & Automation Solid
kotlin-patterns
Idiomatic Kotlin patterns, best practices, and conventions for building robust, efficient, and maintainable Kotlin applications with coroutines, null safety, and DSL builders.
201,447 Updated yesterday
affaan-m AI & Automation Solid
nw-fp-clojure
Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec
526 Updated 1 weeks ago
nWave-ai