Repository: rcardin/raise4s (scala)

Issue:
Add global strategy that let you convert all raised errors in exceptions
The issue was inspired by Jon Pretty's [Contingency](https://soundness.dev/contingency/) library.

It should be possible to import a strategy that lets us transform all the raised errors into exceptions:

```scala
object Experiments {
  def unsafeRaise(error: String): Unit raises String = raise(error)

  def main(args: Array[String]): Unit = {
    import raise4s.throwRaised
    unsafeRaise("Boom")
  }
}
```

The above code should throw an exception containing the `"Boom"` error.

Add a new type of exception to contain the logical errors.

Pull request description:
Closes #70

Patch:
diff --git a/core/src/main/scala/in/rcard/raise4s/Strategies.scala b/core/src/main/scala/in/rcard/raise4s/Strategies.scala
new file mode 100644
index 0000000..016a9bc
--- /dev/null
+++ b/core/src/main/scala/in/rcard/raise4s/Strategies.scala
@@ -0,0 +1,14 @@
+package in.rcard.raise4s
+
+object Strategies {
+
+  /**
+   * An exception that make it easy to throw a logic-typed error if the error is not already a [[Throwable]].
+   *
+   * @param error The logic-typed error to raise
+   * @tparam E The type of the logic-typed error
+   */
+  class UnsafeRaiseException[E](val error: E) extends Exception()
+  
+  type anyRaised = Raise[Any]
+}


Test patch:
diff --git a/core/src/test/scala/in/rcard/raise4s/StrategiesSpec.scala b/core/src/test/scala/in/rcard/raise4s/StrategiesSpec.scala
new file mode 100644
index 0000000..e6a127c
--- /dev/null
+++ b/core/src/test/scala/in/rcard/raise4s/StrategiesSpec.scala
@@ -0,0 +1,17 @@
+package in.rcard.raise4s
+
+import in.rcard.raise4s.Strategies.anyRaised
+import org.scalatest.flatspec.AnyFlatSpec
+import org.scalatest.matchers.should.Matchers
+
+class StrategiesSpec extends AnyFlatSpec with Matchers {
+
+  "anyRaised" should "allow defining a strategy that throw any given error" in {
+    val lambdaRaisingError: Int raises String = Raise.raise("Oops!")
+    given anyRaised = error => throw new RuntimeException(error.toString)
+    val ex = intercept[RuntimeException] {
+      lambdaRaisingError
+    }
+    ex.getMessage shouldBe "Oops!"
+  }
+}