From e5b9ed70c6dfda42e90953d04827c7b6179326a6 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 15 Dec 2019 15:24:27 +0200 Subject: [PATCH] fsharp(ygosim): feat: added a helper to turn a list to indices and another one to check if a list contains an index Signed-off-by: prescientmoon --- fsharp/ygosim/src/Utils.fs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fsharp/ygosim/src/Utils.fs b/fsharp/ygosim/src/Utils.fs index dbf2036..74c8dff 100644 --- a/fsharp/ygosim/src/Utils.fs +++ b/fsharp/ygosim/src/Utils.fs @@ -9,6 +9,9 @@ module List = let (.->) = setIndex + let toIndices list = List.mapi (fun i _ -> i) list + let containsIndex index list = index >= 0 && index < List.length list + module Lens = open FSharpPlus.Lens