Skip to content

Instantly share code, notes, and snippets.

View jmspiewak's full-sized avatar

jmspiewak jmspiewak

  • Poznań, Poland
View GitHub Profile
@jmspiewak
jmspiewak / 8.0 llvm.txt
Last active July 12, 2017 17:30
Iterators: GHC 8.0 vs 8.2
benchmarking cheating
time 243.8 μs (243.2 μs .. 244.4 μs)
1.000 R² (1.000 R² .. 1.000 R²)
mean 244.4 μs (244.2 μs .. 244.7 μs)
std dev 1.055 μs (852.6 ns .. 1.361 μs)
benchmarking boxed vector
time 689.7 μs (685.5 μs .. 693.4 μs)
1.000 R² (0.999 R² .. 1.000 R²)
mean 685.0 μs (681.0 μs .. 689.6 μs)

Monads for Java programmers

Imagine Optional and Stream had two additional methods each:

class Optional<T> {
    // the usual Optional stuff
    // ...

    public static <T> Optional<T> pure(T x) {