From 5893338783b0729a721c5c9f7a7e244f28f6c3ce Mon Sep 17 00:00:00 2001 From: "pl@gohorb.ba-horb.de" Date: Fri, 25 Oct 2024 11:10:00 +0200 Subject: [PATCH] new file: resources/bytecode/javFiles/PaternMatchingHaskellStyle.jav --- .../bytecode/javFiles/PaternMatchingHaskellStyle.jav | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 resources/bytecode/javFiles/PaternMatchingHaskellStyle.jav diff --git a/resources/bytecode/javFiles/PaternMatchingHaskellStyle.jav b/resources/bytecode/javFiles/PaternMatchingHaskellStyle.jav new file mode 100644 index 00000000..c3c58171 --- /dev/null +++ b/resources/bytecode/javFiles/PaternMatchingHaskellStyle.jav @@ -0,0 +1,11 @@ +public record Elem(T a) implements List {} + +public class PaternMatchingHaskellStyle { + public append(LinkedElem(a, Elem(e)), l2) { + return new LinkedElem<>(a, new LinkedElem<>(e, l2)); + } + + public append(LinkedElem(a, r), l2) { + new LinkedElem<>(a, append(r, l2)); + } +}