Skip to content

Commit

Permalink
Rename snoc and cons to append and prepend for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Jacobowitz committed Aug 14, 2018
1 parent 598c057 commit a619082
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/main/scala/cats/data/Chain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,26 @@ sealed abstract class Chain[+A] {
/**
* Returns a new Chain consisting of `a` followed by this. O(1) runtime.
*/
final def cons[A2 >: A](a: A2): Chain[A2] =
final def prepend[A2 >: A](a: A2): Chain[A2] =
append(one(a), this)

/**
* Alias for [[cons]].
* Alias for [[prepend]].
*/
final def +:[A2 >: A](a: A2): Chain[A2] =
cons(a)
prepend(a)

/**
* Returns a new Chain consisting of this followed by `a`. O(1) runtime.
*/
final def snoc[A2 >: A](a: A2): Chain[A2] =
final def append[A2 >: A](a: A2): Chain[A2] =
append(this, one(a))

/**
* Alias for [[snoc]].
* Alias for [[append]].
*/
final def :+[A2 >: A](a: A2): Chain[A2] =
snoc(a)
append(a)

/**
* Applies the supplied function to each element and returns a new Chain.
Expand Down

0 comments on commit a619082

Please sign in to comment.