Skip to content

Instantly share code, notes, and snippets.

@matarillo
matarillo / CatalanNumber.fs
Created March 22, 2017 15:26 — forked from murasesyuka/CatalanNumber.fs
Try F# Generics
let rec fact n =
if n = 0I then 1I
else n * fact (n-1I)
let comb n r =
let a = fact n
let b = fact r
let c = fact (n-r)
(a / (b*c))
@matarillo
matarillo / NeitherTrueNorFalse.cs
Last active May 26, 2016 10:05 — forked from ufcpp/NeitherTrueNorFalse.cs
false でも true でもない何か
using System;
using System.Runtime.InteropServices;
class Program
{
static void Main()
{
Write(false);
Write(true);
using System;
using System.IO;
using System.Linq;
class Program
{
static void Main(string[] args)
{
// 1. Trial.Ofの型引数を明示することで、実引数であるメソッド参照の型が決まる
var result1 = new[] { "aaa", "bbb", "ccc" }