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
| namespace CsharpMonads | |
| { | |
| using System.Collections.Generic; | |
| using Xunit; | |
| public static class DictionaryExtension | |
| { | |
| public static Maybe<S> TryFind<T, S>(this Dictionary<T, S> dict, T key) | |
| { | |
| if (dict.ContainsKey(key)) |
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
| public static class MaybeConcat | |
| { | |
| public static Maybe<T> Concat<T>(this Maybe<T> source1, Func<Maybe<T>> source2F) | |
| { | |
| return source1.IsNone ? source2F() : source1; | |
| } | |
| } | |
| public class HaskellLookupSample | |
| { |
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
| public class EnumerableLookupSample | |
| { | |
| private static readonly Dictionary<string, string> FullNamesDb = | |
| new Dictionary<string, string> | |
| { | |
| { "Bill Gates", "billg@microsoft.com" }, | |
| { "Bill Clinton", "bill@hope.ar.us" }, | |
| { "Michael Jackson", "mj@wonderland.org" } | |
| }; |
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
| type OptionBuilder() = | |
| member b.Delay(f) = f() | |
| member b.Return(x) = | |
| match x with | |
| | None -> None | |
| | Some r -> Some(r) | |
| member b.Bind(p,rest) = |
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
| type OptionBuilder() = | |
| member b.Delay(f) = f() | |
| member b.Return(x) = | |
| match x with | |
| | None -> None | |
| | Some r -> Some(r) | |
| member b.Bind(p,rest) = |
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
| module Server | |
| type StartParams = | |
| { TimeOut: int; | |
| Url: string; } | |
| let startServer serverName startParams = | |
| printfn "%s %d" serverName startParams.TimeOut |
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
| using System; | |
| namespace Aperea.iCalendar | |
| { | |
| public class Calendar | |
| { | |
| public void SetTime(DateTime dateTime) | |
| { | |
| } |
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
| using System; | |
| namespace Aperea.iCalendar | |
| { | |
| public class Calendar | |
| { | |
| public void SetTime(DateTime dateTime) | |
| { | |
| } |
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 System.Collections.Generic | |
| type Box = int | |
| type Sudoku = Box array array | |
| let rows = id | |
| let cols (sudoku:Sudoku) = | |
| sudoku | |
| |> Array.mapi (fun a row -> row |> Array.mapi (fun b cell -> sudoku.[b].[a])) |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
| <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | |
| <description>@description@</description> | |
| <id>@project@</id> | |
| <version>@build.number@</version> | |
| <authors>@authors@</authors> | |
| <owners>@authors@</owners> | |
| <language>en-US</language> | |
| <summary>@summary@</summary> |
OlderNewer