Skip to content

Commit

Permalink
Fix ktlint (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Jun 14, 2021
1 parent f78d5e3 commit bd50541
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import arrow.core.Either
import arrow.core.identity
import arrow.core.left
import arrow.core.right
import com.lenguyenthanh.rxarrow.*
import com.lenguyenthanh.rxarrow.filterZ
import com.lenguyenthanh.rxarrow.flatMapObservableEither
import com.lenguyenthanh.rxarrow.flatMapSingleEither
import com.lenguyenthanh.rxarrow.flatMapSingleZ
import com.lenguyenthanh.rxarrow.flatMapZ
import com.lenguyenthanh.rxarrow.z
import com.technocreatives.beckon.BeckonClient
import com.technocreatives.beckon.BeckonDevice
import com.technocreatives.beckon.BeckonDeviceError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import android.bluetooth.BluetoothGatt
import android.bluetooth.BluetoothGattCharacteristic
import android.bluetooth.BluetoothGattService
import android.content.Context
import arrow.core.*
import arrow.core.Either
import arrow.core.None
import arrow.core.Option
import arrow.core.filterOption
import arrow.core.left
import arrow.core.right
import com.technocreatives.beckon.BleConnectionState
import com.technocreatives.beckon.BondState
import com.technocreatives.beckon.Change
Expand Down
13 changes: 8 additions & 5 deletions beckon/src/main/java/com/technocreatives/beckon/util/Arrows.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.technocreatives.beckon.util

import arrow.core.*
import arrow.core.Nel
import arrow.core.Validated
import arrow.core.nonEmptyListOf
import arrow.core.sequenceValidated
import arrow.typeclasses.Semigroup

fun <E, A> List<Validated<E, A>>.parallelValidate(): Validated<List<E>, List<A>> {
return this.map { it.mapLeft { listOf(it) } }
.sequenceValidated(Semigroup.list())
}
fun <E, A> List<Validated<E, A>>.parallelValidate(): Validated<Nel<E>, List<A>> {
return this.map { it.mapLeft { nonEmptyListOf(it) } }
.sequenceValidated(Semigroup.nonEmptyList())
}

0 comments on commit bd50541

Please sign in to comment.