kategory

项目地址:kategory/kategory
简介:Functional Data Types & Abstractions for Kotlin
更多:作者   提 Bug   官网   
标签:

Download Build Status Kotlin version badge Hex.pm

KΛTEGORY is a library for Typed Functional Programming in Kotlin. It includes the most popular data types, type classes and abstractions such as Option, Try, Either, IO, Functor, Applicative, Monad and many more empowering users to define pure FP apps and libraries built atop higher order abstractions. Use the below list to learn more about KΛTEGORY's main features.

Add it in your root build.gradle at the end of repositories.

allprojects {
    repositories {
        jcenter()
        maven { url 'https://dl.bintray.com/kategory/maven' }
    }
}

Add the dependencies into the project's build.gradle

dependencies {
    compile 'io.kategory:kategory:0.3.11'
    kapt    'io.kategory:kategory-annotations-processor:0.3.11' //optional
    compile 'io.kategory:kategory-effects:0.3.11' //optional
    compile 'io.kategory:kategory-optics:0.3.11' //optional
}

Additional Setup

For projects that wish to use their own @higherkind, @deriving and other meta programming facilities provided by KΛTEGORY the setup below is also required:

Add the dependencies into the project's build.gradle

apply plugin: 'kotlin-kapt' //optional
apply from: rootProject.file('gradle/generated-kotlin-sources.gradle') //optional

dependencies {
    ...
    kapt    'io.kategory:kategory-annotations-processor:0.3.11' //optional
    ...
}

JVM projects:

gradle/generated-kotlin-sources.gradle

apply plugin: 'idea'

idea {
    module {
        sourceDirs += files(
            'build/generated/source/kapt/main',
            'build/generated/source/kaptKotlin/main',
            'build/tmp/kapt/main/kotlinGenerated')
        generatedSourceDirs += files(
            'build/generated/source/kapt/main',
            'build/generated/source/kaptKotlin/main',
            'build/tmp/kapt/main/kotlinGenerated')
    }
}

Android projects:

build.gradle

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
    debug.java.srcDirs += 'build/generated/source/kaptKotlin/debug'
    release.java.srcDirs += 'build/generated/source/kaptKotlin/release'
}

gradle/generated-kotlin-sources.gradle

apply plugin: 'idea'

idea {
    module {
        sourceDirs += files(
                'build/generated/source/kapt/main',
                'build/generated/source/kapt/debug',
                'build/generated/source/kapt/release',
                'build/generated/source/kaptKotlin/main',
                'build/generated/source/kaptKotlin/debug',
                'build/generated/source/kaptKotlin/release',
                'build/tmp/kapt/main/kotlinGenerated')
        generatedSourceDirs += files(
                'build/generated/source/kapt/main',
                'build/generated/source/kapt/debug',
                'build/generated/source/kapt/release',
                'build/generated/source/kaptKotlin/main',
                'build/generated/source/kaptKotlin/debug',
                'build/generated/source/kaptKotlin/release',
                'build/tmp/kapt/main/kotlinGenerated')
    }
}

License

Copyright (C) 2017 The Kategory Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
随手点击下面广告,支持我维护本站吧
随手点击下面广告支持我免费维护吧
Android 开发经验分享
随手点击下面广告支持本站吧
 
Android 开发经验分享