Skip to content

Instantly share code, notes, and snippets.

View vijayanant's full-sized avatar

Vijay Anant vijayanant

View GitHub Profile
@vijayanant
vijayanant / TypeFamilies.hs
Created November 30, 2018 17:40
Type Families - WIP
{-# LANGUAGE TypeFamilies
, DataKinds
, PolyKinds
, TypeInType
, TypeOperators
, UndecidableInstances
, RankNTypes
#-}
@vijayanant
vijayanant / Git Branching and Releasing for Happy Developers.md
Last active July 29, 2019 14:22
Git Branching and Releasing for Happy Developers

Git Branching and Realeasing

AIM

To make below listed activites simple (from SCM point of view)

  • Adding new features
  • Fixing bugs
  • Preparing for release
  • Deploying to production
  • Applying hotfixes
  • Versioning
@vijayanant
vijayanant / gadt1.hs
Created April 8, 2020 03:45
GADT Code Samples
data Point = Pt Int Int
data Expr a = Number Integer | Boolean Bool
@vijayanant
vijayanant / carncdr.py
Created June 4, 2021 15:47
Simple Python problem #1 --- pair, car, and cdr
# Problem Statement
# cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair.
# For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4.
# Given the below implementation for cons( ), please implement car & cdr
def cons(a, b):
def pair(f):
return f(a, b)
return pair
@vijayanant
vijayanant / TraitSum.rs
Created March 1, 2025 11:02
Rust - Traits
trait Summable {
fn zero() -> Self;
fn add(&self, other: &Self) -> Self;
}
impl Summable for i32 {
fn zero() -> Self {
0
}
fn add(&self, other: &Self) -> Self {