Skip to content

Instantly share code, notes, and snippets.

View objectx's full-sized avatar

Masashi Fujita objectx

View GitHub Profile
@KevinAst
KevinAst / article.md
Last active April 12, 2025 07:55
Integrating GitBook with JSDoc to Document Your Open Source Project

Integrating GitBook with JSDoc to Document Your Open Source Project

Introduction

Good documentation should include two distinct elements - a Guide and an API:

  1. The Guide builds concepts, providing examples, etc.

GitBook is well suited to

@voluntas
voluntas / naze_erlang.rst
Last active October 31, 2023 03:33
なぜ Erlang/OTP を使い続けるのか
@vincenthz
vincenthz / CStruct.hs
Last active September 1, 2019 10:45
CStruct in haskell
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
module CStruct where
@lotz84
lotz84 / haskell_maxims_and_arrows.md
Created February 2, 2017 15:05
Haskell Maxims and Arrows という Reddit の投稿が面白かったので訳しました

以下 Haskell Maxims and Arrows の翻訳


私は2001年から仕事でもプライベートでもHaskellを書いてきました。仕事で書いていたのはそのうち3年のことです。これらは私が学んだことです…

  1. Haskellは理解すれば理解するほどきれいに書けることを約束してくれます。信頼してください
  2. 常にパターンを探しましょう。単純になるとき、またその時だけそれらを抽象化するのです
  3. 辛抱強く抽象化を正しく理解しましょう。もしそれが出来たならすべてのことが魔法のようにつじつまが合うようになるでしょう。
  4. 実装そのものが設計図となります
@y-taka-23
y-taka-23 / alloy_kubernetes.als
Last active December 19, 2016 19:08
Alloy による Kubernetes のコンテナスケジューリングのモデリング
open util/ordering[Time]
sig Time {}
abstract sig Event {
pre, post : Time,
} {
post = pre.next
}
anonymous
anonymous / playground.rs
Created December 15, 2016 03:40
Shared via Rust Playground
// [Rust で 言語処理100本ノック 第1章 前半 - 僕とコードとブルーハワイ](http://equal-001.hatenablog.com/entry/2016/12/14/232933)
// にコメントフォームがなかったのでコードぶん投げます
//# 00. 文字列の逆順
//文字列"stressed"の文字を逆に(末尾から先頭に向かって)並べた文字列を得よ.
fn no_00() -> String {
let s = "stressed";
s.chars()
.rev()
// 型を入れないとエラーになるのはcollectがジェネリックなため、推論出来ないから。
@voluntas
voluntas / dropbox_api_v2.rst
Last active December 14, 2021 06:38
Dropbox API v2 仕様まとめ
@keigoi
keigoi / Lens.kt
Last active December 12, 2016 05:05
An attempt of simple implementation of lens on Java 8
class IxMonad<X,Y,T>(val x:T) {}
class Cons<HD,TL>(val hd : HD, val tl : TL) {}
class Nil();
fun <X,Y,T> ret(x: T) : IxMonad<X,Y,T> {
return IxMonad<X,Y,T>(x)
}
fun <T> run(m : IxMonad<Nil,Nil,T>) : T {
(* Good morning everyone, I'm currently learning ocaml for one of my CS class and needed to implement
an avl tree using ocaml. I thought that it would be interesting to go a step further and try
to verify the balance property of the avl tree using the type system. Here's the resulting code
annotated for people new to the ideas of type level programming :)
*)
(* the property we are going to try to verify is that at each node of our tree, the height difference between
the left and the right sub-trees is at most of 1. *)