This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Dummy login model **/ | |
@JvmInline | |
value class UserName(val value: String) | |
@JvmInline | |
value class Password(val value: String) | |
/** | |
* A [Reaction] is always parametric to a type of [Action] | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dbactions | |
import arrow.continuations.Effect | |
import arrow.continuations.generic.DelimitedScope | |
import kotlin.reflect.KClass | |
/** | |
* An abstract connection | |
*/ | |
interface Connection { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Coming up ~ April 2020 */ | |
package test | |
import arrow.* | |
inline class TwitterHandle(val handle: String) { | |
companion object : Refined<String> { | |
override val validate: String.() -> Map<String, Boolean> = { | |
mapOf( | |
"Should start with '@'" to startsWith("@"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package arrow.prelude.test | |
import arrow.continuations.generic.DelimContScope | |
import arrow.continuations.generic.DelimitedScope | |
abstract class ST<S, A> @PublishedApi internal constructor() { | |
companion object { | |
operator fun <S, A> invoke(a: () -> A): ST<S, A> { | |
val memo by lazy(a) | |
return object : ST<S, A>() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Bifunctor IO */ | |
class IO<out E, out A> : | |
`*`<IO<*, *>>, | |
`*-*`<IO<*, *>, A>, | |
`*-*-*`<IO<*, *>, E, A> { | |
fun <B> fmap(f: (A) -> B): IO<Nothing, B> = TODO() | |
fun <B> flatMap(f: (A) -> `*-*`<IO<*, *>, B>): IO<Nothing, B> = TODO() | |
fun <C, D> bimap(fl: (E) -> C, fr: (A) -> D): IO<C, D> = TODO() | |
companion object { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow.fx.* | |
import arrow.fx.extensions.* | |
import arrow.fx.typeclasses.* | |
import arrow.fx.extensions.io.bracket.guaranteeCase | |
fun <A> IOOf<A>.onCancel(token: IOOf<Unit>): IO<A> = | |
guaranteeCase { case -> | |
when (case) { | |
ExitCase.Canceled -> token | |
else -> IO.unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package arrow.rules.test | |
import arrow.Kind | |
import arrow.core.Either | |
import arrow.core.EitherPartialOf | |
import arrow.core.Nel | |
import arrow.core.NonEmptyList | |
import arrow.core.Validated | |
import arrow.core.ValidatedPartialOf | |
import arrow.core.extensions.either.applicativeError.applicativeError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow.Kind | |
import arrow.core.Option | |
import arrow.core.Try | |
import arrow.core.functor | |
import arrow.effects.IO | |
import arrow.effects.fix | |
import arrow.effects.functor | |
import arrow.typeclasses.Functor | |
/* algebras */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package arrow.meta.ide.plugins.proofs.contracts | |
import kotlin.contracts.Effect | |
import kotlin.contracts.ExperimentalContracts | |
interface TypeLevelEffect : Effect | |
interface Declaration : Effect | |
fun declaration(): Declaration = TODO() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package arrow.meta.plugins.helloWorld | |
import arrow.meta.Meta | |
import arrow.meta.Plugin | |
import arrow.meta.invoke | |
import arrow.meta.phases.analysis.ElementScope | |
import arrow.meta.quotes.ClassScope | |
import arrow.meta.quotes.Scope | |
import arrow.meta.quotes.Transform | |
import arrow.meta.quotes.classOrObject |