This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package eu.javaland.fpworkshop.categorytheory; | |
import static org.assertj.core.api.Assertions.assertThat; | |
import java.util.function.Function; | |
import net.jqwik.api.ForAll; | |
import net.jqwik.api.Property; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.gtrefs.fizzbuzz.more; | |
import javaslang.collection.Stream; | |
import javaslang.test.Arbitrary; | |
import javaslang.test.Property; | |
import org.junit.jupiter.api.Test; | |
import static org.assertj.core.api.Assertions.assertThat; | |
public class FizzBuzzStream { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Function; | |
import java.util.function.IntPredicate; | |
import java.util.stream.IntStream; | |
import org.junit.Test; | |
public class Primes { | |
final IntPredicate isPrime = x -> IntStream.rangeClosed(2, (int) (Math.sqrt(x))).allMatch(n -> x % n != 0); | |
final Function<Integer, IntStream> till = max -> IntStream.iterate(1, i -> i + 1).filter(isPrime).limit(max); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import sys | |
def read_list_of_java_annotations(path): | |
if os.path.isfile(path): | |
with open(path, "r") as f: | |
return map(lambda s: s.strip(), f.readlines()) | |
else: | |
return [] |