Skip to content

Commit

Permalink
Change package naming (#44)
Browse files Browse the repository at this point in the history
* Change Rule module back to uppercase.

* Changed package names. #41

Co-authored-by: Attila Mihaly <[email protected]>
  • Loading branch information
AttilaMihaly and ozmi authored Jul 13, 2020
1 parent 9d6ae6a commit 90f1100
Show file tree
Hide file tree
Showing 38 changed files with 105 additions and 105 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.internal.collection.decorators
package morphir.internal.collection.decorators

import scala.collection.GenTraversableLike

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.internal.collection
package morphir.internal.collection

import scala.collection.generic.IsTraversableLike
import scala.language.implicitConversions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import org.morphir.sdk.Maybe.Maybe
import morphir.sdk.Maybe.Maybe

private[sdk] trait MaybeLike[+A] extends Product with Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.morphir.sdk
package morphir.sdk

import morphir.sdk.Maybe._
import morphir.sdk.String.String

import org.morphir.sdk.Maybe._
import org.morphir.sdk.String.String
import scala.util.Try

object StringOps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.internal.collection.decorators
package morphir.internal.collection.decorators

import scala.collection.GenTraversableLike

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.internal.collection
package morphir.internal.collection

import scala.collection.generic.IsTraversableLike
import scala.language.implicitConversions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import org.morphir.sdk.Maybe.Maybe
import morphir.sdk.Maybe.Maybe

private[sdk] trait MaybeLike[+A] extends Product with Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.morphir.sdk
package morphir.sdk

import morphir.sdk.Maybe.Maybe

import org.morphir.sdk.Maybe._
import org.morphir.sdk.String.String
import scala.util.Try

object StringOps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.internal.collection.decorators
package morphir.internal.collection.decorators

import scala.collection.generic.IsIterable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.internal.collection
package morphir.internal.collection

import scala.collection.generic.{ IsIterable }
import scala.collection.generic.IsIterable

package object decorators {
implicit def iteratorDecorator[A](it: Iterator[A]): IteratorDecorator[A] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import org.morphir.sdk.Maybe.Maybe
import morphir.sdk.Maybe.Maybe

private[sdk] trait MaybeLike[+A] extends IterableOnce[A] with Product with Serializable

Expand Down
9 changes: 9 additions & 0 deletions morphir/sdk/core/src-2.13/morphir/sdk/StringOps.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package morphir.sdk

import morphir.sdk.Maybe.Maybe
import morphir.sdk.String.String

object StringOps {
@inline def toInt(text: String): Maybe[Int] =
text.toIntOption
}
9 changes: 0 additions & 9 deletions morphir/sdk/core/src-2.13/org/morphir/sdk/StringOps.scala

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.internal.collection.decorators
package morphir.internal.collection.decorators

/** Enriches Iterator with additional methods. */
class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import String.String
import morphir.sdk.String.String

object Bool {
type Bool = Boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.sdk
package morphir.sdk

//TODO: We need to think how we want to represent chars as Elm chars support full unicode
// : but java cannot store full unicode in a single char
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import Maybe._
import morphir.sdk.Maybe._

object Dict {
sealed abstract class Dict[K, +V]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.sdk
package morphir.sdk

object Int {
type Int = scala.BigInt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import org.morphir.sdk.Maybe.{ Just, Maybe }
import morphir.sdk.Maybe.{ Just, Maybe }

object List {
type List[+A] = scala.List[A]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.sdk
package morphir.sdk

object LocalDate {
type LocalDate = java.time.LocalDate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.sdk
package morphir.sdk

import scala.util.{ Failure, Success, Try }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.sdk
package morphir.sdk

import scala.{ Char => ScalaChar }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import org.morphir.sdk.NonEmptyListModule.NonEmptyList.{ Cons, Single }
import morphir.sdk.NonEmptyListModule.NonEmptyList.{ Cons, Single }

import scala.annotation.tailrec

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.morphir.sdk
package morphir.sdk

object Number {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import org.morphir.sdk.Maybe.Maybe
import morphir.sdk.Maybe.Maybe

import scala.util.matching.{ Regex => RE }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import Maybe._
import morphir.sdk.Maybe._

sealed abstract class Result[+E, +A] extends Product with Serializable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.morphir.sdk
package morphir.sdk

import org.morphir.sdk.Bool.Bool
import org.morphir.sdk.Maybe.Maybe
import org.morphir.sdk.List.List
import morphir.sdk.Bool.Bool
import morphir.sdk.List.List
import morphir.sdk.Maybe.Maybe

object rule {
object Rule {

type Rule[A, B] = A => Maybe[B]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.morphir.sdk
package morphir.sdk

import org.morphir.sdk.Maybe.Maybe
import morphir.sdk.Maybe.Maybe

object String {
type String = scala.Predef.String
Expand Down
6 changes: 6 additions & 0 deletions morphir/sdk/core/src/morphir/sdk/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package morphir

package object sdk {
val StringModule: StringModule = String
type StringModule = String.type
}
6 changes: 0 additions & 6 deletions morphir/sdk/core/src/org/morphir/sdk/package.scala

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.morphir.internal.collection.decorators
package morphir.internal.collection.decorators

import zio.test._
import zio.test.Assertion._
import zio.test._

object IterableDecoratorSpec extends DefaultRunnableSpec {
def spec = suite("IterableDecoratorSpec")(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.morphir.sdk
package morphir.sdk

import zio.test._
import zio.test.Assertion._
import zio.test._

object CharSpec extends DefaultRunnableSpec {
def spec = suite("CharSpec")(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.morphir.sdk
package morphir.sdk

import zio.test._
import morphir.sdk
import morphir.sdk.Int._
import zio.test.Assertion._
import Int._
import org.morphir.sdk
import zio.test._

object IntSpec extends DefaultRunnableSpec {
def spec = suite("IntSpec")(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.morphir.sdk
package morphir.sdk

import zio.duration._
import zio.test._
import zio.test.Assertion._
import zio.test.TestAspect.timeout
import zio.test._

object ListSpec extends DefaultRunnableSpec {
def spec = suite("ListSpec")(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.morphir.sdk
package morphir.sdk

import Maybe.Maybe
import zio.test._
import morphir.sdk.Maybe.Maybe
import zio.test.Assertion._
import zio.test._

object MaybeSpec extends DefaultRunnableSpec {
def spec = suite("MaybeSpec")(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.morphir.sdk
package morphir.sdk

import zio.test._
import zio.test.Assertion._
import zio.test._

object ResultSpec extends DefaultRunnableSpec {
def spec = suite("ResultSpec")(
Expand Down Expand Up @@ -39,7 +39,7 @@ object ResultSpec extends DefaultRunnableSpec {
},
test("Given an Err in value A should return that value") {
val bad: Result[String, Int] = Result.Err("No Bueno!")
val inputb = Result.Ok(1).withErr[String]
val inputb = Result.Ok(1).withErr[String]
assert(
Result.map2((a: Int, b: Int) => a * b * 2)(bad)(inputb)
)(
Expand All @@ -48,7 +48,7 @@ object ResultSpec extends DefaultRunnableSpec {
},
test("Given an Err in value B should return that value") {
val bad: Result[String, Int] = Result.Err("No Bueno!")
val inputa = Result.Ok(1).withErr[String]
val inputa = Result.Ok(1).withErr[String]
assert(
Result.map2((a: Int, b: Int) => a * b * 2)(inputa)(bad)
)(
Expand Down
Loading

0 comments on commit 90f1100

Please sign in to comment.