発表場所: | .NET基礎勉強会 |
---|---|
トゥギャッター: | http://togetter.com/li/536460 |
資料のライセンス: | CC-BY-SA 3.0 |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace LinqStudy | |
{ | |
public class LinqStudy | |
{ | |
public static int Euler1(int max) | |
{ |
原文: | Async in C# and F#: Asynchronous gotchas in C# |
---|---|
原文著者: | Tomas Petricek (@tomaspetricek) |
翻訳者: | @pocketberserker |
2月に、私は毎年恒例のMVPサミット ── Microsoft が MVP のために主催するイベント ── に出席しました。私はボストンとニューヨークを訪問する機会を利用して、二つの F# に関する講演と Channel9 lecture about type providers の収録を行いました。他のすべての活動(しばしばパブで他の F#er を議論に巻き込んだり、朝まで長い睡眠)にもかかわらず、私はいくつかの講演に参加し果せました。
今朝、 「F# のインデントガイドライン」に寄せて という記事がアップされてましたので、便乗します。
単純に「私はこんなインデントルールでやっています」というオレオレを書いておきたいだけです。大元の F# のインデントガイドライン と一緒のものについては省略します。
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
module DrinkStock | |
type Drink = { | |
name : string | |
price : int | |
} | |
type DrinkStock = Drink list | |
let init = [{name = "コーラ"; price = 120}; {name = "レッドブル"; price = 200}; {name = "水"; price = 100}] |> List.map (Array.create 5) |> Seq.concat |> Seq.toList |
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
// NaturalSpec: https://github.com/forki/NaturalSpec | |
// unquote: http://code.google.com/p/unquote/ | |
open NaturalSpec.Utils | |
open NaturalSpec | |
open NUnit.Framework | |
open Swensen.Unquote | |
let check (assertType,a,b,value) = | |
let outputFail f message = |
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
namespace FSharpx | |
type Stream<'a> = | |
| Chunk of 'a | |
| Empty | |
| EOF | |
type Iteratee<'el,'a> = | |
| Done of 'a * Stream<'el> | |
| Error of exn | |
| Continue of (Stream<'el> -> Iteratee<'el,'a>) |
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
(* | |
Reference: http://en.wikipedia.org/wiki/Levenshtein_distance#Example | |
kitten → sitten (substitution of 's' for 'k') | |
sitten → sittin (substitution of 'i' for 'e') | |
sittin → sitting (insertion of 'g' at the end). | |
*) | |
open FSharpx.DataStructures | |
open FSharpx.ByteString |
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 FSharpx | |
let test () = | |
let rand = Random() | |
let list = Seq.init 20000 (fun _ -> rand.Next()) |> Seq.distinct |> Seq.toList | |
let d = 3 | |
let n = 1 | |
let t1 = DateTime.Now |