32 lines
541 B
Forth
32 lines
541 B
Forth
namespace web_api_cookbook
|
|
|
|
open WebSharper
|
|
|
|
[<JavaScript>]
|
|
module Option =
|
|
let getOrElse def opt =
|
|
if Option.isSome opt
|
|
then Option.get opt
|
|
else def
|
|
|
|
[<JavaScript>]
|
|
module Units =
|
|
module Animation =
|
|
[<Measure>]
|
|
type frames
|
|
module Time =
|
|
[<Measure>]
|
|
type ms
|
|
[<Measure>]
|
|
type s
|
|
|
|
[<JavaScript>]
|
|
module Math =
|
|
let clamp a b c =
|
|
if c < a then a
|
|
else if c > b then b
|
|
else c
|
|
|
|
[<Inline>]
|
|
let inline lerp a b t = a + t * (b - a)
|