adt4j icon indicating copy to clipboard operation
adt4j copied to clipboard

adt4j - Algebraic Data Types for Java

Results 12 adt4j issues
Sort by recently updated
recently updated
newest added

Restructuring my build and when I add adt4j to the annotation class path I get the following error: [ERROR] Unexpected exception. This seems like a bug in ADT4J, please report...

This probably requires a new specialized annotation, but it would be really cool if adt4j could help to define GADTs in Java! This is what I am after: https://gist.github.com/jbgi/208a1733f15cdcf78eb5

research

Add @GenerateTags annotation to generate `enum` with tag-values. Following code ``` java @GenerateTags(enumName = "OptionalTag", methodName = "tag") @GenerateValueClassForVisitor(className = "Optional") @Visitor(resultVariableName="R") interface OptionalVisitor { R present(@Nonnull T value); R...

Following @nobeh comment in #15 > Let's consider this psuedo/modelling code: > > ``` > data Map = EmptyMap | InsertAssoc(Pair, Map); > ``` > > which defines a `Map`...

Allow definitions like this: ``` java interface SomeVisitor { R callable(U callable); R immediate(T value); } ``` So we can write ``` java int eval(SomeValue value) { return value.accept(new SomeVisitor()...

More examples. Document open-recursion trick for recursive data-structures. Document selfReferenceVariableName parameter.

Following #18 discussion. @jbgi So, you are after something like this in the end: ``` java @GenerateValueClass(className = "ListImpl") abstract class List { public static List cons(T head, List tail)...

research

This should work... ``` java Optional i = flag ? Optional.present(5) : Optional.missing(); Optional m = i.withValue("5"); // Generated updater method ```

Allow to optionally generate implementation of [Isomorphism](https://github.com/sviperll/chicory/blob/master/chicory-core/src/main/java/com/github/sviperll/Isomorphism.java) or TypeStructure[[2](https://github.com/sviperll/chicory/blob/master/chicory-core/src/main/java/com/github/sviperll/TypeStructure2.java),[3](https://github.com/sviperll/chicory/blob/master/chicory-core/src/main/java/com/github/sviperll/TypeStructure3.java),[4](https://github.com/sviperll/chicory/blob/master/chicory-core/src/main/java/com/github/sviperll/TypeStructure4.java)] from chicory library to use for structure-generic transformations (like ORM or serialization) on generated value-classes.

I figure serialization should be pretty trivial with object mapping solutions such as Gson and Jackson But deserialization (at least in Jackson) requires some boilerplate + some type information in...

research