haf / yolo Goto Github PK
View Code? Open in Web Editor NEWEffing utilities.
License: Other
Effing utilities.
License: Other
I added your YoLo file to a project of mine, using paket. But build fails on windows but passes on mono. In windows I have to remove the internal module modifier. See: https://ci.appveyor.com/project/halcwb/genunitapp/build/1.0.102 and
https://travis-ci.org/halcwb/GenUnitApp/builds/141458423
Would it make sense to use YoLo from NuGet in addition to paket?
Hi, there is a problem with https://github.com/haf/YoLo/blob/master/YoLo.fs#L593, if calling assembly doesnt have that attribute - NRE will be raised even if App.Version static field doesnt used due F#/.NET some optimization.
I spot that issue with SuaveIO/suave@a37f7ea by running Example console, build by VS2013 in Release configuration. .NET 4.5, F# runtime 4.3.1.0.
Maybe Value should be string option
instead of string
.
I'd like to adopt YoLo.fs instead of my own very similar file. I'd like to get a few more things from mine in here, so your thoughts on the following would be appreciated:
module Option =
let inline getOrElse d o =
match o with
| Some v -> v
| None -> d
Top-level functions:
/// Const function. ignores the second argument
let ct v = fun _ -> v
/// Const function. Ignores the second and third arguments.
let ct2 v = fun _ _ -> v
/// Const function. Ignores 3 additional arguments.
let ct3 v = fun _ _ _ -> v
/// Invokes the provided function.
let inline invoke f = f()
/// Applies the function to the argument provided
let inline apply x f = f x
/// Composes two predicates with lazy evaluation
let inline (>&&>) b1 b2 v = b1 v && b2 v
/// Composes two predicates with lazy evaluation
let inline (>||>) b1 b2 v = b1 v || b2 v
/// As for (>>) but for a function f with two arguments.
let inline (>>+) f g a b = g (f a b)
/// As for (>>) but for a function f with three arguments.
let inline (>>++) f g a b c = g (f a b c)
/// As for (>>) but for a function f with four arguments.
let inline (>>+++) f g a b c d = g (f a b c)
/// Clamps a value between a min and a max
let inline clamp minValue maxValue x = max minValue (min x maxValue)
/// Clamp a value between zero and one
let inline clamp10 x = clamp LanguagePrimitives.GenericZero LanguagePrimitives.GenericOne x
Dictionary
module Dictionary =
open System.Collections.Generic
let getOpt (dict : Dictionary<_, _>) key =
match dict.TryGetValue(key) with
| (true, value) -> Some(value)
| (false, _) -> None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.