This file contains 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
#top: | |
Change: position: absolute; to position: fixed; | |
Change: top: -40px; to top: 0; | |
#left, #right: | |
Change: position: relative; to position: fixed; | |
#main: | |
Remove: position: relative; | |
Add: margin-left: 381px; |
This file contains 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
module MissingTypeClassesIntegration.List where | |
import MissingTypeClasses | |
import Prelude hiding (foldl, foldl1, foldr, foldr1, map, filter, zip) | |
instance RecursiveDataStructure [] where | |
unit = [] | |
cons = (:) | |
instance LeftFoldable [] where |
This file contains 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 com.jnape.palatable.lambda.applicative; | |
import com.jnape.palatable.lambda.functions.MonadicFunction; | |
import static com.jnape.palatable.lambda.functions.builtin.monadic.Identity.id; | |
@FunctionalInterface | |
public interface BiFunctor<A, B> { | |
default <C> BiFunctor<C, B> biMapL(MonadicFunction<? super A, ? extends C> fn) { |
This file contains 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 example; | |
import java.util.Optional; | |
class Foo {} | |
interface Bar { | |
String barMethod(); | |
} | |
public class TypeUnifailcation extends Foo implements Bar { |
This file contains 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 com.jnape.palatable.lambda.adt.Either; | |
import com.jnape.palatable.lambda.functions.Fn3; | |
import com.jnape.palatable.lambda.functor.Functor; | |
import com.jnape.palatable.lambda.functor.builtin.Identity; | |
import java.util.function.Function; | |
import static com.jnape.palatable.lambda.adt.Either.left; | |
import static com.jnape.palatable.lambda.adt.Either.right; |
This file contains 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.io.IOException; | |
public class ExceptionalExceptionHandling { | |
public static void main(String[] args) { | |
ThrowingSupplier<IllegalStateException, String> wellTyped = () -> { | |
throw new IllegalStateException(); | |
}; | |
ThrowingSupplier<RuntimeException, String> wellTypedButUnnecessary = () -> { |
This file contains 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
public class WreckedCast { | |
@SuppressWarnings("unchecked") | |
static <P, PP extends Parametric<P>> PP wreckedCast(Parametric<? extends Parametric<P>> ppp) { | |
return (PP) ppp.extract(); | |
} | |
public static void main(String[] args) { | |
// java.lang.ClassCastException: WreckedCast$Parametric$$Lambda$1/1607521710 cannot be cast to java.lang.String | |
System.out.println(wreckedCast(Parametric.parametric(Parametric.parametric(1)))); |
This file contains 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
public static class SetIsNotAFullyFaithfulFunctor { | |
public static void main(String[] args) { | |
class Mod { | |
private final int mod; | |
private final int value; | |
Mod(int mod, int value) { | |
this.mod = mod; | |
this.value = value; | |
} |
This file contains 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 spike; | |
import com.jnape.palatable.lambda.adt.choice.Choice2; | |
import com.jnape.palatable.lambda.adt.coproduct.CoProduct2; | |
import com.jnape.palatable.lambda.functions.Fn1; | |
import com.jnape.palatable.lambda.functions.Fn2; | |
import com.jnape.palatable.lambda.functions.builtin.fn2.Cons; | |
import com.jnape.palatable.lambda.functor.Bifunctor; | |
import java.util.Iterator; |
This file contains 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 example; | |
import com.jnape.palatable.lambda.functions.builtin.fn2.Cons; | |
import com.jnape.palatable.lambda.functions.builtin.fn2.Snoc; | |
import java.util.Iterator; | |
import static com.jnape.palatable.lambda.functions.builtin.fn3.FoldLeft.foldLeft; | |
import static example.SizedIterable.Nat.s; | |
import static example.SizedIterable.Nat.stringify; |