Skip to content

Releases: melvic-ybanez/chi

v0.1.0-RC

29 Mar 19:22
Compare
Choose a tag to compare
v0.1.0-RC Pre-release
Pre-release

The main focus of this release was the support for Java syntax:

chi> <A, B> B apply(A a, Function<A, B> f)
Detected language: Java
Generated code:
<A, B> B apply(A a, Function<A, B> f) {
    return f.apply(a);
}

chi> <A, B, C> Function<A, C> compose(Function<B, C> f, Function<A, B> g)
Detected language: Java
Generated code:
<A, B, C> Function<A, C> compose(Function<B, C> f, Function<A, B> g) {
  return a -> f.apply(g.apply(a));
}

chi> <A, B, C> BiFunction<A, B, C> foo(Function<A, C> f)
Detected language: Java
Generated code:
<A, B, C> BiFunction<A, B, C> foo(Function<A, C> f) {
  return (a, b) -> {
    f.apply(a)
  };
}

What's Changed

Full Changelog: v0.1.0-beta...v0.1.0-rc

Edit: The last Java example isn't working in this release (I realized this too late). However, in the latest code the issue has been fixed.

v0.1.0-beta

27 Mar 18:53
Compare
Choose a tag to compare
v0.1.0-beta Pre-release
Pre-release

This release focused on bug fixes, particularly the disjunction elimination and exhaustive search for functions by their consequents.

For example, the following shows correct derivation of code based on disjunction-elimination:

chi> def foo[A, B, C]: (A => C) => (B => C) => Either[A, B] => C
def foo[A, B, C]: ((A => C) => ((B => C) => (Either[A, B] => C))) =
  f => g => e => e match {
    case Left(a) => f(a)
    case Right(b) => g(b)
  }

chi> def foo[A]: Either[A, A] => A
def foo[A]: (Either[A, A] => A) =
  e => e match {
    case Left(a) => a
    case Right(a) => a
  }

What's Changed

Full Changelog: v0.1.0-alpha...v0.1.0-beta

v0.1.0-alpha

12 Mar 06:04
Compare
Choose a tag to compare
v0.1.0-alpha Pre-release
Pre-release

This release supports a REPL that allows the users to enter function signatures and see the results immediately. In the current version, Chi only recognizes the Scala syntax.