Good documentation should include two distinct elements - a Guide and an API:
- The Guide builds concepts, providing examples, etc.
GitBook is well suited to
更新: | 2017-04-03 |
---|---|
作者: | @voluntas |
バージョン: | 1.0.6 |
URL: | https://voluntas.github.io/ |
2017 年 4 月 1 日に行われた Elixir Conf Japan 2017 の発表者用のメモです。
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
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
module CStruct where |
以下 Haskell Maxims and Arrows の翻訳
私は2001年から仕事でもプライベートでもHaskellを書いてきました。仕事で書いていたのはそのうち3年のことです。これらは私が学んだことです…
- Haskellは理解すれば理解するほどきれいに書けることを約束してくれます。信頼してください
- 常にパターンを探しましょう。単純になるとき、またその時だけそれらを抽象化するのです
- 辛抱強く抽象化を正しく理解しましょう。もしそれが出来たならすべてのことが魔法のようにつじつまが合うようになるでしょう。
- 実装そのものが設計図となります
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
open util/ordering[Time] | |
sig Time {} | |
abstract sig Event { | |
pre, post : Time, | |
} { | |
post = pre.next | |
} |
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
// [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がジェネリックなため、推論出来ないから。 |
日時: | 2016-12-10 |
---|---|
作: | @voluntas |
バージョン: | 0.1.1 |
url: | https://voluntas.github.io/ |
概要
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
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 { |
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
(* 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. *) |