Skip to content

Instantly share code, notes, and snippets.

@Agnishom
Agnishom / immerman.hs
Created February 8, 2019 03:01
A Haskell-Aware Explanation of Immerman–Szelepcsényi Theorem
{-# LANGUAGE FlexibleContexts #-}
import Control.Monad
import Control.Monad.State
type NonDet a = [a]
type NonDetState s a = StateT s [] a
type Vertex = Int
@Agnishom
Agnishom / monadic_party.md
Created February 3, 2019 16:16
Monadic Party SOP

I am a final year undergraduate student of Mathematics and (Theoretical) Computer Science studying in Chennai Mathematical Institute, India. My interests in computer science are along the lines of programming languages and logic.

My interest in functional programming began as a leisure activity, but became more serious when I took my first introductory Haskell Course. As time progressed, I educated myself through the means of several internet blogs and other online resources. I also took a follow up course titled "Implementation of Functional Programming" where we discussed the challenges of the implementational aspects of languages with functional abstraction. In the subsequent year, I offered to be the teaching assistant of the same introductory Haskell course which was my initial inspiration. Not only did I tutor this course in my institution, but also over online courses conducted by NPTEL, twice in a row.

Last summer, I interned at a technological start-up VacationLabs, Goa where we used functional p

@Agnishom
Agnishom / smt.txt
Created August 4, 2018 17:35
SMT Course
Symbolic Analysis Using SMT Solvers (SASS)
Instructor: M.K. SrivasFirst
Meeting: Aug 8 (Wed) 3:30PM, Lec Hall 801
Satisfiability-Modulo Theory (SMT) solver is a sound algorithmic framework for combining automatic decision procedures for first-order (i.e., quantifier-free) theories of data types, such as propositional logic, un-interpreted functions, bit-vectors, arithmetic, arrays, pointers, etc., that commonly occur in modern programming languages. Advances in SMT solving technology in the recent past have enabled development of tools - interactive theorem provers, model checkers, guided-synthesizers - for practical formal verification and synthesis of sequential and concurrent SW systems. This course covers the theory and practice of SMT solvers providing hands-on exposure to the use of SMT solvers. The topics of the course will be distributed over two not necessarily contiguous parts. The first part will cover the basic principles and theory behind construction of SMT solvers, describing in detail dec
@Agnishom
Agnishom / Main.elm
Created July 19, 2018 05:30
Translator Pattern
import Page exposing (..)
import Http
import Json.Decode as Decode
import Task
import Html
main =
Html.program
{ init = init
, view = view
@Agnishom
Agnishom / update.elm
Created July 18, 2018 06:46
Elm Arch
update : Msg -> Model -> (Model, Cmd Msg, Maybe LoadingCounter)
update =
case msg of
Produce cmd -> (model, cmd, Just Increment)
Consume -> (model, Cmd.none, Just Decrement)
msg ->
let
(newModel, newCmd) = realUpdate msg model
in
(newModel, newCmd, Nothing)
module AnalyticPage exposing (..)
import AutoGen exposing (..)
import Navigation
import Http
import Array
import Html exposing (..)
import Html.Attributes exposing (..)
import FileReader
import Json.Decode
@Agnishom
Agnishom / app.elm
Last active July 4, 2018 11:33
Elm Plan
import AutoGen exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Http
import Json.Decode as Decode
import Platform.Cmd
main =
@Agnishom
Agnishom / powerset.hs
Last active June 30, 2018 15:01
List Monad as Non-deterministic computation
import Control.Monad.Random
arbitrarySet :: Monad m => m Bool -> [a] -> m [a]
arbitrarySet getBool = flip foldr (return []) $ \x ls -> do
t <- getBool
l <- ls
if t
then return (x:l)
else return l
@Agnishom
Agnishom / diagram.hs
Created June 22, 2018 09:04
Code for creating an circle with spokes
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
rules :: Diagram B
rules = foldr1 (<>) hands
where