0 people like it.
Like the snippet!
Minimum Covering
https://twitter.com/kot_2010/status/607115335255392256
1:
2:
3:
4:
5:
|
let minimumCovering col1 (col2:int list) =
col1
|> List.mapi (fun i x -> System.Math.Max(x, col2.[i]))
minimumCovering [1;2;5;7;9;11] [0;3;4;6;8;10]
|
val minimumCovering : col1:int list -> col2:int list -> int list
Full name: Script.minimumCovering
val col1 : int list
val col2 : int list
Multiple items
val int : value:'T -> int (requires member op_Explicit)
Full name: Microsoft.FSharp.Core.Operators.int
--------------------
type int = int32
Full name: Microsoft.FSharp.Core.int
--------------------
type int<'Measure> = int
Full name: Microsoft.FSharp.Core.int<_>
type 'T list = List<'T>
Full name: Microsoft.FSharp.Collections.list<_>
Multiple items
module List
from Microsoft.FSharp.Collections
--------------------
type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IEnumerable
interface IEnumerable<'T>
member Head : 'T
member IsEmpty : bool
member Item : index:int -> 'T with get
member Length : int
member Tail : 'T list
static member Cons : head:'T * tail:'T list -> 'T list
static member Empty : 'T list
Full name: Microsoft.FSharp.Collections.List<_>
val mapi : mapping:(int -> 'T -> 'U) -> list:'T list -> 'U list
Full name: Microsoft.FSharp.Collections.List.mapi
val i : int
val x : int
namespace System
type Math =
static val PI : float
static val E : float
static member Abs : value:sbyte -> sbyte + 6 overloads
static member Acos : d:float -> float
static member Asin : d:float -> float
static member Atan : d:float -> float
static member Atan2 : y:float * x:float -> float
static member BigMul : a:int * b:int -> int64
static member Ceiling : d:decimal -> decimal + 1 overload
static member Cos : d:float -> float
...
Full name: System.Math
System.Math.Max(val1: decimal, val2: decimal) : decimal
(+0 other overloads)
System.Math.Max(val1: float, val2: float) : float
(+0 other overloads)
System.Math.Max(val1: float32, val2: float32) : float32
(+0 other overloads)
System.Math.Max(val1: uint64, val2: uint64) : uint64
(+0 other overloads)
System.Math.Max(val1: int64, val2: int64) : int64
(+0 other overloads)
System.Math.Max(val1: uint32, val2: uint32) : uint32
(+0 other overloads)
System.Math.Max(val1: int, val2: int) : int
(+0 other overloads)
System.Math.Max(val1: uint16, val2: uint16) : uint16
(+0 other overloads)
System.Math.Max(val1: int16, val2: int16) : int16
(+0 other overloads)
System.Math.Max(val1: byte, val2: byte) : byte
(+0 other overloads)
More information