Sha256: 4a463a940b250257631de51ac9119c81e50bf17c26bf0fcb8f7fd0c370019444
Contents?: true
Size: 319 Bytes
Versions: 132
Compression:
Stored size: 319 Bytes
Contents
module Grains open System.Numerics let square (n:int) = if n <= 0 || n > 64 then Error "Invalid input" else Ok (2I ** (n - 1) |> uint64) let total = [1..64] |> List.map square |> List.reduce (fun x y -> match x, y with Ok a, Ok b -> Ok (a + b) | _ -> Error "Invalid input")
Version data entries
132 entries across 132 versions & 1 rubygems