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
let rec visitor dir = | |
seq { | |
for subdir in listOfFolders dir do | |
yield subdir | |
yield! visitor subdir | |
} |
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
let rec visitor dir = | |
seq { yield! | |
( try Directory.GetFiles(dir) | |
with ex -> | |
(* actually do something *) | |
Array.empty ) | |
for subdir in Directory.GetDirectories(dir) do yield! visitor subdir} |
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 System | |
open System.ServiceModel | |
open System.ServiceModel.Description | |
[<ServiceContract(ConfigurationName = "PublishService", Namespace = "http://xyz.gov/PublishService")>] | |
[<ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession)>] | |
type IPublishService = | |
[<OperationContract(Name="TestMethod")>] | |
abstract member TestMethod : name:string -> string | |
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
// there have got to be better ways to do this? | |
let splitList (f:'a -> bool) (list:'a list) = | |
let op (nested:'a list list) (thing: 'a) = | |
if f thing then | |
[] :: nested | |
else | |
match nested with | |
| [] -> [[thing]] | |
| headlist::rest -> (thing :: headlist) :: rest |
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
-- givens and exercises from Ch 2 of Haskell School of Expression | |
-- | |
module Shape (Shape (Rectangle, Ellipse, RightTriangle, Polygon), | |
Radius, Side, Vertex, | |
square, circle, distBetween, area | |
) where | |
data Shape = Rectangle Side Side | |
| Ellipse Radius Radius |
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
Building Doctypes... | |
Testing Doctypes... | |
47 run, 46 passed, 1 failed, 0 inconclusive, 1 skipped (1 ignored) | |
Slowest: seq | |
[("DTC.Doctypes/TestLanguage/Include only these folders", 677.0); | |
("DTC.Doctypes/TestStatutes/Has children", 595.0); | |
("DTC.Doctypes/SharedLaw/Plain to separated", 513.0); | |
("DTC.Doctypes/TestSharedLawReferences/Paragraph nested in subsection only", | |
428.0); ...] | |
Loading up 'DTC.Doctypes/TestSharedLawReferences/Paragraph nested in subsection only' for fixage |
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
(* | |
autotest.fsx | |
20100826 - dgfitch@gmail.com | |
Inspired by ruby autotest. | |
Tracks a set of projects, building and testing them automatically with Gallio | |
as they are modified. | |
Should work with xUnit.Net, MbUnit, NUnit, MsTest, or whatever other framework |
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
(* Simple Gallio test runner, usable from FSI *) | |
#r "Gallio.dll" | |
open Gallio.Runner | |
open Gallio.Runtime.Logging | |
let launcher = new TestLauncher() | |
let setup = new Gallio.Runtime.RuntimeSetup() | |
setup.AddPluginDirectory @"C:\Program Files\Gallio\bin" | |
setup.RuntimePath <- @"C:\Program Files\Gallio\bin" |
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
(* Sample F# active pattern for comparison *) | |
let (|LessThan|_|) x y = if y <= x then Some() else None | |
match 4 with | |
| LessThan 2 -> "uhh something is wrong" | |
| _ -> "yay math" |
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
Get-ChildItem -Recurse | | |
Where-Object { !$_.PSIsContainer } | | |
Foreach-Object { | |
Write-Host("<p><a href='{0}'>{1}</a></p>" -f ($_.FullName.Replace($pwd, "").Trim('\')), $_.Name) | |
} |