public static Position Create(Fen fen) { ulong[] maps = new ulong[14]; int i = 0; fen.ForEachPosition() .Where(c => !'/'.Equals(c)) .Select(c => new { index = i += int.TryParse(c.ToString(), out int result) ? result : 1, piece = c })
public static Error FenError(Fen fen) => new FenError(fen);
public FenError(Fen fen) { Fen = fen; }
public static Option <Fen> CreateFen(this string fenString) => Fen.Of(fenString);
public static Either <string, Option <Fen> > CreateFen(this Either <string, string> fenString) => fenString.Map(f => Fen.Of(f));