http://rust-lang.github.io/rfcs/1522-conservative-impl-trait.html
- Fature Name: conservative_impl_trait
- Start Date: 2016-01-31
- RFC PR: rust-lang/rfcs#1522
- Rust Issue: rust-lang/rust#34511
-module(fizzbuzz). | |
-export([start/1]). | |
start(End) -> | |
Pid = self(), | |
FizzBuzz = spawn(fun() -> fizzbuzz(Pid, End) end), | |
Fizz = spawn(fun() -> fizz(3) end), | |
Buzz = spawn(fun() -> buzz(5) end), | |
FizzBuzz ! {Fizz, Buzz}, | |
receive |
Inductive A : Set := a : A. | |
Definition fantom (n : nat) := A. | |
Definition fantom_succ {n : nat} : fantom n -> fantom (S n) := | |
fun _ => a. | |
Inductive ty : forall n : nat, fantom n -> Prop := | |
| zero : ty O a | |
| succ : forall (x : nat) (f : fantom x), ty x f -> ty (S x) (fantom_succ f). |
{-# LANGUAGE FlexibleContexts | |
, TypeOperators | |
, DeriveDataTypeable | |
, ConstraintKinds | |
, FlexibleInstances | |
, MultiParamTypeClasses | |
, UndecidableInstances #-} | |
import Control.Eff | |
import Control.Eff.Exception |
Set Implicit Arguments. | |
Unset Strict Implicit. | |
(** Type Definitions *) | |
Inductive IndexedContsT (W M : Type -> Type) (R O A : Type) : Type := | |
| mkIndexedContsT : (W (A -> M O) -> M R) -> IndexedContsT W M R O A. | |
Definition runIndexedContsT W M R O A (c : IndexedContsT W M R O A) : W (A -> M O) -> M R := | |
match c with |
require 'csv' | |
classes = {} | |
file = ARGV[1] | |
GENEKI = '現役生' | |
OBOG = 'OBOG' | |
OTHER = 'その他' | |
CSV.foreach(file) do |row| |
#!/usr/bin/env bash | |
FOCAL=focal.dat | |
WC=~/tmp/wc.rb | |
if [[ "$1" == "-t" && ! -z "$2" ]]; then | |
exiftool -T -focallengthin35mmformat *.JPG | grep -v '-' | awk '{print NR, $0}' > $FOCAL | |
gnuplot -p -e "set terminal png; set term png size 2000,500; set term png font 'ヒラギノ丸ゴ ProN W4, 16'; set output '$2'; set xlabel 'n枚目'; set ylabel '焦点距離'; plot '$FOCAL' using 1:2:(1) with boxes" | |
rm $FOCAL | |
open $2 |
Array.prototype.map.call(document.querySelectorAll("table tbody tr"), function (tr) { var c = tr.children; return c[2].textContent + "年" + c[3].textContent + "組" + "『" + c[4].textContent + "』"; }).join("\n"); |
http://rust-lang.github.io/rfcs/1522-conservative-impl-trait.html
参照に関するパターンマッチをよりわかりやすくします。
現在、参照に関するパターンマッチは ref
と &
を使いわけなければいけません。
module Main where | |
import Control.Monad | |
import Data.List (nub) | |
data Coin = Black | White | Blank deriving (Eq, Ord) | |
instance Show Coin where | |
show Black = "●" | |
show White = "○" |