Skip to content

Instantly share code, notes, and snippets.

View alexyakunin's full-sized avatar
👨‍💻
Working on something new!

Alex Yakunin alexyakunin

👨‍💻
Working on something new!
View GitHub Profile
open System.Threading
let rec countRecursivelyAsync count = async {
if count <= 0 then
return count
else
let! result = countRecursivelyAsync(count - 1)
return result + 1
}
using System;
using System.Threading;
using System.Threading.Tasks;
namespace CSharpAsyncRecursion
{
class Program
{
static void Main(string[] args)
{
using System;
using System.Threading;
using System.Threading.Tasks;
namespace CSharpAsyncRecursion
{
class Program
{
static void Main(string[] args)
{
using System;
namespace CSharpRecursion
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Counted to {0}.", CountRecursively(10000));
}