Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Fix recusive reference in monoid list #296

Merged
merged 2 commits into from
Jan 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion arrow-core-data/src/main/kotlin/arrow/core/List.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import arrow.typeclasses.Semigroup
import arrow.typeclasses.Show
import arrow.typeclasses.defaultSalt
import arrow.typeclasses.hashWithSalt
import kotlin.collections.plus as _plus

fun <A> Eq.Companion.list(EQA: Eq<A>): Eq<List<A>> =
ListEq(EQA)
Expand Down Expand Up @@ -122,7 +123,7 @@ fun <A> Monoid.Companion.list(): Monoid<List<A>> =

object ListMonoid : Monoid<List<Any?>> {
override fun empty(): List<Any?> = emptyList()
override fun List<Any?>.combine(b: List<Any?>): List<Any?> = this + b
override fun List<Any?>.combine(b: List<Any?>): List<Any?> = this._plus(b)
}

fun <A> Show.Companion.list(SA: Show<A>): Show<List<A>> =
Expand Down