nw-fp-kotlin

Solid

Kotlin language-specific patterns with Arrow, Raise DSL, and coroutine-based effects

AI & Automation 526 stars 55 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
91
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

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