jimn
01/06/2020, 2:28 PM/** left identity */
object `⟳` {
operator fun <T> invoke(t: T) = { t: T -> t }
}
/** left identity */
val <T> T.`⟳` get() = `⟳` ( this)
/**right identity*/
val <T> T.`⟲` get() = { this }raulraja
01/06/2020, 5:34 PMfun <A> A.identity(): A = this
fun <A> identity(ev: A): A = evjimn
01/06/2020, 5:40 PMjimn
01/06/2020, 5:41 PMjimn
01/06/2020, 5:42 PMraulraja
01/06/2020, 5:53 PMraulraja
01/06/2020, 5:53 PMjimn
01/06/2020, 6:04 PM⟲ ( G ⚬ F) verbatim. This works in kotlin type checking for my Vector abstraction which appears to fulfil the semigroup where a ( G ⚬ F) does not cooperate on an infix viable basis.
i have backwards and forards composition of the same basic functors as below.
IOMemento.IoLocalDate to Tokenized(
dateMapper ⚬ trim ⚬ btoa ⚬ bb2ba,
{ a, b -> a.putLong(b.toEpochDay()) }),
IOMemento.IoInstant to Tokenized(
bb2ba → btoa → trim → instantMapper,
{ a, b -> a.putLong(b.toEpochMilli()) })jimn
01/06/2020, 6:06 PMraulraja
01/06/2020, 6:09 PM