Skip to content

Instantly share code, notes, and snippets.

Inductive Term : Set :=
| T
| F
| TIf (_ : Term) (_ : Term) (_ : Term).
Inductive Step : Term -> Term -> Prop :=
| EIfTrue : forall (t1 t2 : Term), Step (TIf T t1 t2) t1
| EIfFalse : forall (t1 t2 : Term), Step (TIf F t1 t2) t2
| EIf : forall (t1 t1' t2 t3 : Term), Step t1 t1' -> Step (TIf t1 t2 t3) (TIf t1' t2 t3).
@mzp
mzp / gist:ebbd01613736beda61bd
Last active August 29, 2015 14:13
SML# contrib.md

目標

see: https://github.com/bleis-tift/SmlSharpContrib

SML#のライブラリが足りないのでなんとかしたい。

方針(検討中)

  • こったライブラリにはしない
  • 適当なCライブラリの薄いラッパにする
  • メソッドはすべて移植する(よっぽど不要なやつは省く?)
@yukitos
yukitos / Collector.fs
Last active October 3, 2015 16:02
WIP: Trying to fix MissingMethodException of Persimmon.VisualStudio.TestExplorer.
namespace Persimmon.Runner.Wrapper
open Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging
open System
open System.Collections.Generic
open System.Reflection
module private TestCollectorImpl =
open Persimmon
import scalaz._, Scalaz._
case class KnightPos(c: Int, r: Int) {
def move: List[KnightPos] =
for {
KnightPos(c2, r2) <- List(KnightPos(c + 2, r - 1), KnightPos(c + 2, r + 1),
KnightPos(c - 2, r - 1), KnightPos(c - 2, r + 1),
KnightPos(c + 1, r - 2), KnightPos(c + 1, r + 2),
KnightPos(c - 1, r - 2), KnightPos(c - 1, r + 2)) if (
((1 |-> 8) element c2) && ((1 |-> 8) contains r2))
package msgpack4z
import java.math.BigInteger
import scodec.Attempt
import scodec.bits.{BitVector, ByteVector}
import scodec.msgpack.codecs.MessagePackCodec
import scodec.msgpack.{MNil, MessagePack, Serialize}
object ScodecPacker {
@Gab-km
Gab-km / papylon_doc.ja.rst
Last active December 8, 2015 03:08
ぱぴろん非公式ドキュメント

ぱぴろん非公式ドキュメント

ぱぴろんとは?

ぱぴろん(Papylon)は、満たすべき性質(property)を記述することでテストケースを自動生成する Python 用テスティングツールです。いわゆる"QuickCheck"系の流れを汲み、 FsCheckScalaCheck の影響を強く受けています。テストしたい対象の振る舞うべき性質を記述して実行すると、テストケースをランダムに生成して実行し、性質が成り立つかどうかを確認します。

簡単な例

@xuwei-k
xuwei-k / Scataz.md
Last active December 28, 2015 00:40
Scalaz Cats
Cobind CoflatMap
Bind FlatMap
MonadPlus MonadCombine
PlusEmpty MonoidK
Foldable1 Reducible
Plus SemigroupK
These Ior
Validation Validated
@leque
leque / gist:8035729
Last active December 31, 2015 19:49

各言語のコレクション操作高階関数(メソッド、手続き)

Language
Common Lisp mapc mapcar find-if remove-if-not reduce reduce :from-end t some every
Scheme for-each map find filter fold, fold-left fold-right any, exists every, for-all
Haskell mapM_ map find filter foldl foldr any all
Caml Light do_list map - - it_list list_it exists for_all
OCaml iter map find filter, find_all fold_left fold_right exists for_all
F# iter map find filter fold foldBack exists forall
@t3t5u
t3t5u / gist:d8c1b65e7dbd54ae4549
Last active February 14, 2016 06:23
Plumtree

Push-Lazy-Push Multicast Tree.

高いスケーラビリティ、信頼性 (Reliability) 、回復力 (Resiliency) を達成するため、 流行性のブロードキャスト (Epidemic Broadcast) と、 決定論的なツリーに基づくブロードキャスト (Deterministic Tree-Based Broadcast) を統合する。

純粋な Gossip Protocol と異なり、ブロードキャスト用のツリーを構築するフェーズで、冗長な転送経路が取り除かれるので、重複するメッセージが大量に転送されることはない。

@leque
leque / freer-monad.scm
Last active May 11, 2016 01:35
Freer monad in Scheme
;;;; Freer monad in Scheme
;;;; See also
;;;; * "Freer monads, more extensible effects"
;;;; http://dl.acm.org/citation.cfm?doid=2804302.2804319
;;;; * Free monad in Scheme https://gist.github.com/wasabiz/951b2f0b22643a59aeb2
(use gauche.record)
(use util.match)
;;; data Freer f a where
;;; Pure :: a -> Freer f a