Skip to content

Instantly share code, notes, and snippets.

View adithyaov's full-sized avatar

Adithya Kumar adithyaov

View GitHub Profile
@adithyaov
adithyaov / initial-notes.md
Last active October 22, 2025 11:24
Initial notes on Cardano

Abstract

At a very high level, smart contracts are essentially validators to either allow or reject certain transactions (state transitions). These validations + policies essentially encode the logic of the application.

States & state transitions are encoded by Datum and Redeemer. Of course, the validator validates this state transition.

New currency and assets can be minted or burned. The minted and the burned values are part of the transaction whose validity is checked by the associated policy (Currency hash ~ Minting policy hash).

The foundational datatype of the smart contract is essentially just the validator. Everything else is just data that the validator requires to check the validity of the transaction.

@adithyaov
adithyaov / postgres14.nix
Created August 14, 2025 19:20
Flake providing Postgres 14
{
description = "Flake providing Postgres 14";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/branch-off-24.11";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux"; # change if needed

📢 Announcing streamly 0.9.0! 🎉

Streamly, the powerful streaming library for Haskell, has just released version 0.9.0, packed with exciting new features and improvements. With Haskell's strong type safety and C-program-like performance capabilities, streamly continues to provide a seamless and efficient development experience.

Here's what you can expect from streamly 0.9.0:

🔒 Monomorphic Stream Type: In this release, we have introduced a monomorphic Stream type, replacing the polymorphic IsStream t type. This change enhances code clarity and simplifies usage.

⚡ Performance Improvements: We have removed the reliance on GHC rewrite rules, allowing for more power and transparency in the performance behavior. Now, as a programmer, you have greater control and visibility over performance-related aspects.

@adithyaov
adithyaov / GHCByteArrayAlignmentTest.hs
Last active August 18, 2022 15:01
Test for checking the properties of GHC byte array alignment
import Data.Foldable (forM_)
import Data.Word(Word8)
import Foreign.Storable (Storable(..))
import GHC.Ptr (Ptr (..))
import GHC.Base (addr2Int#, int2Word#)
import Streamly.Internal.Data.Unboxed
( MutableByteArray(..)
, Unbox(..)
, Unboxed
, castContents
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- |
-- Description: Template Haskell code for persistent. This code needs to be in
-- a separate module because of GHC stage restriction.
-- Some of the code in this module is inspired by neat-interpolation by
-- nikita-volkov.
@adithyaov
adithyaov / .bashrc
Last active August 12, 2020 02:34
Dot files
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
@adithyaov
adithyaov / ProgressGSoC2019.md
Last active August 21, 2019 08:10
Documenting progress during GSoC 2019 with Haskell.Org

Inroduction

The following document describes my contributions to the organization Haskell.Org during GSoC 2019. All my contribution are towards a project called [Alga][alga].

Note :

  1. This document is subject to change in the near future.
  2. All module name are prepended with Algebra.Graph. It is omitted in the following document for readability.

Expected task list

@adithyaov
adithyaov / Acyclic.hs
Last active July 22, 2019 19:38
Implementation with shrink
module Acyclic.AdjacencyMap where
import qualified AdjacencyMap as AM
newtype AdjacencyMap a = AAM {
-- Unexported
underlying :: AM.AdjacencyMap a
}
instance Show (AdjacencyMap a) where
@adithyaov
adithyaov / AcyclicMoand.hs
Last active May 4, 2019 10:18
Acyclic Examples
module AcyclicMonad (dag, singleton, edgeTo) where
-- Only export dag, singleton and edgeTo.
import Control.Monad.Trans.State.Strict
type Vertex = Int
newtype DAG = DAG DAG' deriving Show
-- eg. Edges 4 [2, 3] (Edges 3 [1] (Edges 2 [1] (Edges 1 [] Nil)))