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 language.experimental.macros | |
import reflect.macros.Context | |
object WeirdMacro { | |
def show_structure(something: Any): String = macro show_structure_impl | |
def show_structure_impl(c: Context)(something: c.Expr[Any]): c.Expr[String] = { | |
import c.universe._ | |
c.Expr[String](Literal(Constant(something.tree.toString))) |
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
Require Import Coq.Program.Basics. | |
Require Import Coq.Program.Syntax. | |
Require Import Coq.Init.Datatypes. | |
Require Import Coq.Unicode.Utf8. | |
Open Local Scope program_scope. | |
Open Local Scope list_scope. | |
Open Local Scope type_scope. | |
Class Functor (φ : Type → Type) := { |
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 com.myapp | |
object IntegerFunctions { | |
val increment: Int => Int = _ + 1 | |
val decrement: Int => Int = _ + 1 | |
val lolNoIntegers: String => String = _ + "!!!" | |
} |
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
#include <iostream> | |
using namespace std; | |
template <int N> struct Factorial { | |
enum { value = N * Factorial<N - 1>::value }; | |
}; | |
template <> struct Factorial<0> { | |
enum { value = 1 }; | |
}; |
NewerOlder