This file contains 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
type trie = Trie of int option * char_to_children | |
and char_to_children = (char * trie) list | |
let empty = | |
Trie (None, []) | |
let example = | |
Trie (None, | |
[('i', Trie (Some 11, | |
[('n', Trie (Some 5, [('n', Trie (Some 9, []))]))])); |
This file contains 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 <type_traits> | |
namespace m_utl | |
{ | |
template <typename... Types> | |
struct type_tuple {}; | |
// 関数の型を受け取り、戻り値を推定するメタ関数 | |
// ジェネリックラムダ以外であればこの中の何れかにオーバーロードされる | |
namespace result_of_function_impl |
This file contains 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 Core.Std;; | |
type car_query = | |
| And of car_query * car_query | |
| Or of car_query * car_query | |
| Term of string * string | |
let cons_exn arg = | |
let cons_term_exn item = | |
match String.split item '=' with |
This file contains 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
"3.10.1 | |
"set ft=vimperator: | |
" アドオンインストール時の待ち時間カット | |
set! security.dialog_enable_delay=0 | |
" j,kによる上下スクロールの移動量を5倍に設定 | |
noremap j 5<C-e> | |
noremap k 5<C-y> |
This file contains 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 List;; | |
let fizzbuzz min max = | |
let say cur = | |
match (cur mod 3, cur mod 5) with | |
| (0, 0) -> "FizzBuzz" | |
| (0, _) -> "Fizz" | |
| (_, 0) -> "Buzz" | |
| (_, _) -> string_of_int cur | |
in |
This file contains 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 <utility> | |
#include <type_traits> | |
namespace m_utl | |
{ | |
template <typename T> | |
struct identity { using type = T; }; | |
template <std::size_t N, typename T = void> |
This file contains 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
#pragma once | |
#include <tuple> | |
#include <iterator> | |
#include "tpl_utl.hpp" | |
namespace m_utl | |
{ | |
// support only forward_iterator | |
// e.g.) input {1,2,3}, {"abc","def","ghi"} -> output {{1,"abc"},{2,"def"},{3,"ghi"}} |
NewerOlder