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 Test { | |
interface Foo {} | |
static abstract class Super {} | |
static class Sub1 extends Super implements Foo {} | |
static class Sub2 extends Super implements Foo {} | |
public static void main(String[] args) { |
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
#include <iostream> | |
#include <functional> | |
#include <optional> | |
template<template<typename> typename F> | |
struct Functor | |
{ | |
template<typename A, typename B> | |
static F<B> map(const F<A> &, const std::function<B (const A &)> &); | |
}; |
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
#![feature(slice_patterns)] | |
type PhonebookError = String; | |
#[derive(Debug)] | |
struct PhonebookEntry | |
{ | |
name: String, | |
phone_numbers: Vec<u32> | |
} |
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 Main where | |
import Control.Monad | |
import Data.Char | |
import Data.Either | |
import Data.List.Split | |
type PhonebookError = String | |
data PhonebookEntry = PhonebookEntry |
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 Main | |
import IdrisJvm.FFI | |
import IdrisJvm.IO | |
import Java.Lang | |
%default total | |
record Java a ret 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
{-# LANGUAGE TypeFamilies, DataKinds #-} | |
module Main where | |
import Java | |
import System.IO | |
data Command = Command @org.bukkit.command.Command | |
deriving Class |
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 Data.List | |
onOdds :: ([a] -> [a]) -> [a] -> [a] | |
onOdds f xs = | |
let | |
(odds, evens) = partition (odd . fst) $ zip [0..] xs | |
in | |
concat $ | |
zipWith | |
(\a b -> [a, b]) |