Skip to content

Instantly share code, notes, and snippets.

View jfrank-summit's full-sized avatar

Jeremy Frank jfrank-summit

View GitHub Profile
@jfrank-summit
jfrank-summit / metadata.json
Created October 15, 2021 22:43
New Project
{"valueParameterInfo":[],"slotParameterDescriptions":[],"roleDescriptions":[],"contractType":"O","contractShortDescription":"","contractName":"","contractLongDescription":"","choiceInfo":[]}
@jfrank-summit
jfrank-summit / Constrained.Types.fs
Last active April 15, 2019 17:35
F# Signature File - Constrained Types
module StringConstraints
open System
let stringPattern str pattern =
if String.IsNullOrEmpty(str) then
let msg = sprintf "%s: Must not be null or empty" str
Error msg
elif System.Text.RegularExpressions.Regex.IsMatch(str, pattern) then
Ok (str)
else
let msg = sprintf "'%s' must match the pattern '%s'" str pattern