<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>go on ankit bahuguna</title>
    <link>https://ankitbahuguna.xyz/tags/go/</link>
    <description>Recent content in go on ankit bahuguna</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 16 Oct 2023 18:48:12 +0530</lastBuildDate>
    <atom:link href="https://ankitbahuguna.xyz/tags/go/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Lazy Evaluation</title>
      <link>https://ankitbahuguna.xyz/posts/lazy-evaluation/</link>
      <pubDate>Mon, 16 Oct 2023 18:48:12 +0530</pubDate>
      <guid>https://ankitbahuguna.xyz/posts/lazy-evaluation/</guid>
      <description>Learning OCaml and Lazy Evaluation Lazy evaluation is a cool concept that delays computations until they&amp;rsquo;re actually needed, saving resources and time. OCaml is great for this, but TypeScript and Go can do it too in their own ways.
OCaml Example OCaml uses lazy streams to generate Fibonacci numbers:
type &amp;#39;a stream = Cons of &amp;#39;a * &amp;#39;a stream Lazy.t let rec fibs a b = Cons (a, lazy (fibs b (a + b))) let rec take n (Cons (x, xs)) = if n &amp;lt;= 0 then [] else x :: take (n - 1) (Lazy.</description>
    </item>
  </channel>
</rss>
