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 FsCheck.Ext | |
| module Test = | |
| open System | |
| open FsCheck | |
| open FsCheck.Arb | |
| type JapaneseChar = char | |
| let japaneseChar (s: string) : JapaneseChar = |
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
| let values = [ 1;2;3;2;3;1 ] | |
| let f y x = | |
| if x = y then Choice2Of2 1 | |
| else if x < y then Choice1Of2 2 | |
| else Choice2Of2 3 | |
| let ``all values are Choice1Of2`` = | |
| values | |
| |> List.map (f 4) | |
| let sequence1 = |
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
| internal static class DateTimeUtil | |
| { | |
| public static DateTime Min(params DateTime[] values) | |
| { | |
| if (values == null) | |
| throw new ArgumentNullException("values"); | |
| var comparer = new DateTimeComparer(); | |
| Array.Sort<DateTime>(values, comparer); | |
| return values[0]; |
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
| <!-- (snip) --> | |
| <GridViewColumn Header="Result" DisplayMemberBinding="{Binding Result}"> | |
| <GridViewColumn.CellTemplate> | |
| <DataTemplate> | |
| <TextBlock Text="{Binding}"> | |
| <TextBlock.Style> | |
| <Style TargetType="{x:Type TextBlock}"> | |
| <Style.Triggers> | |
| <MultiDataTrigger> | |
| <MultiDataTrigger.Conditions> |
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
| var msi = new ActiveXObject("WindowsInstaller.Installer"); | |
| var msiOpenDatabaseModeReadOnly = 0; | |
| var db = msi.OpenDatabase("test.msi", msiOpenDatabaseModeReadOnly); | |
| var view = db.OpenView("SELECT * FROM Property WHERE Property = 'ProductCode'"); | |
| view.Execute(); | |
| for (var r = view.Fetch(); r != null; r = view.Fetch()) { | |
| WScript.Echo(r.StringData(1) + "=" + r.StringData(2)); | |
| } | |
| view.Close(); |
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 | |
| open System.Reflection | |
| [<AttributeUsage(AttributeTargets.All, AllowMultiple = true)>] | |
| type MyAttribute() = | |
| inherit Attribute() | |
| // MyAttributeを継承しているのでAllowMultipleがtrueになっているはず。。。 | |
| type MyDerivedAttribute() = | |
| inherit MyAttribute() |
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.Windows.Forms | |
| // Copied from: http://social.msdn.microsoft.com/Forums/ja-JP/d5f23c87-b8d5-4c95-9293-3239f70caf94/f-first-class-events-and-cli-standards?forum=fsharpgeneral | |
| type FunctionWrapper<'args>(f:obj -> 'args -> unit) = | |
| member x.Invoke(sender:obj, args) = | |
| f sender args | |
| module Event = | |
| let filter (pred:'args->bool) (ev:IEvent<'del,'args>) = |
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
| function makeNum(n, f) { | |
| if (f == null) { return n; } | |
| else { return f(n); } | |
| } | |
| function five(f) { | |
| return makeNum(5, f); | |
| } | |
| function seven(f) { | |
| return makeNum(7, f); | |
| } |
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
| <PropertyGroup> | |
| <!-- snip --> | |
| <TypeScriptToolsVersion>1.0</TypeScriptToolsVersion> | |
| </PropertyGroup> | |
| <Target Name="BeforeBuild"> | |
| <MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="<dependentAssembly>([\s]+.)<assemblyIdentity name="FSharp\.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" \/>([\s\S]+?)<\/dependentAssembly>" RegexOptionList="IgnoreCase|Singleline" Replacement="<dependentAssembly>
 <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
 <bindingRedirect oldVersion="0.0.0.0-$(TargetFSharpCoreVersion)" newVersion="$(TargetFSharpCoreVersion)"/>
 </dependentAssembly>" Files="web.config" /> | |
| <ItemGroup> | |
| <TSFiles Include="@(None);@(TypeScriptCompile)" Condition=" '%(Extension)' == '.ts' " /> | |
| </ItemGroup> | |
| <Exec Command=""$(PROGRAMFI |
NewerOlder