Skip to content

Commit

Permalink
[REFACTOR]: idk but look how shiny!
Browse files Browse the repository at this point in the history
  • Loading branch information
csgn committed Jul 24, 2024
1 parent 5fe93df commit 920be55
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 38 deletions.
2 changes: 1 addition & 1 deletion example/src/main/scala/MonoidExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package example

import kuram.monoid.*
import kuram.monoid.Monoid
import kuram.monoid.instances.given
import kuram.semigroup.syntax.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package kuram
package category

object CategoryInstances:
package object instances:
given Category[Function1] with
def id[A]: A => A = identity
def compose[A, B, C](f: B => C, g: A => B): A => C = f compose g
4 changes: 1 addition & 3 deletions src/main/scala/kuram/category/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
*/

package kuram
package category

package object instances:
export CategoryInstances.given
package object category
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
package kuram
package compose

object ComposeInstances:
package object instances:
given Compose[Function1] with
def compose[A, B, C](f: B => C, g: A => B): A => C = f compose g
7 changes: 1 addition & 6 deletions src/main/scala/kuram/compose/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@
*/

package kuram
package compose

package object instances:
export ComposeInstances.given

package object syntax:
export ComposeSyntax.*
package object compose
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package kuram
package compose

object ComposeSyntax:
package object syntax:
extension [F[_, _], A, B, C](f: F[B, C])
def <<<(g: F[A, B])(using c: Compose[F]): F[A, C] = c.compose(f, g)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package kuram
package foldable

object FoldableInstances:
package object instances:
given Foldable[List] with
extension [A](as: List[A])
override def foldRight[B](acc: B)(f: (A, B) => B): B =
Expand Down
7 changes: 1 addition & 6 deletions src/main/scala/kuram/foldable/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@
*/

package kuram
package foldable

package object instances:
export FoldableInstances.given

package object syntax:
export FoldableSyntax.*
package object foldable
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package kuram
package foldable

object FoldableSyntax:
package object syntax:
extension [F[_]: Foldable, A, B](foldable: F[A])
/** @see Alias of [[kuram.foldable.Foldable.foldRight]]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package kuram
package monoid

object MonoidInstances:
package object instances:
given Monoid[Int] with
def empty: Int = 0
def combine(a: Int, b: Int): Int = a + b
Expand Down
4 changes: 1 addition & 3 deletions src/main/scala/kuram/monoid/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
*/

package kuram
package monoid

package object instances:
export MonoidInstances.given
package object monoid
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package kuram
package semigroup

object SemigroupInstances:
package object instances:
given Semigroup[Int] with
def combine(a: Int, b: Int): Int = a + b

Expand All @@ -31,4 +31,3 @@ object SemigroupInstances:

given [A]: Semigroup[List[A]] with
def combine(a: List[A], b: List[A]): List[A] = a ++ b

7 changes: 1 addition & 6 deletions src/main/scala/kuram/semigroup/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@
*/

package kuram
package semigroup

package object instances:
export SemigroupInstances.given

package object syntax:
export SemigroupSyntax.*
package object semigroup
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package kuram
package semigroup

object SemigroupSyntax:
package object syntax:
/** @see Alias of [[kuram.semigroup.Semigroup.combine]]
*/
extension [T](a: T)
Expand Down
1 change: 0 additions & 1 deletion tests/src/test/scala/kuram/CategorySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package kuram

import compose.syntax.*
import compose.instances.given
import category.instances.given

class CategorySuite extends munit.FunSuite:
Expand Down
3 changes: 1 addition & 2 deletions tests/src/test/scala/kuram/MonoidSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@

package kuram

import semigroup.*
import semigroup.syntax.*

import monoid.*
import monoid.Monoid
import monoid.instances.given

class MonoidSuite extends munit.FunSuite:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/scala/kuram/SemigroupSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package kuram

import semigroup.*
import semigroup.Semigroup
import semigroup.syntax.*
import semigroup.instances.given

Expand Down

0 comments on commit 920be55

Please sign in to comment.