Skip to content

Instantly share code, notes, and snippets.

View mbrc12's full-sized avatar

Mriganka Basu Roy Chowdhury mbrc12

View GitHub Profile
@mbrc12
mbrc12 / CmdSpec.md
Last active March 20, 2018 18:46
Specification of the command line tool for purity and nullability analysis

Specification of the command line tool for purity and nullability analysis

Throughout this document, a ! means that the said option is not implemented yet.

The following specificies the details of the command line interface exposed by the tool. Please note that this is subject to change:

The options:

The following options are planned as of yet:

Keybase proof

I hereby claim:

  • I am mbrc12 on github.
  • I am mbrc (https://keybase.io/mbrc) on keybase.
  • I have a public key ASAXtAlWlE3KqhP4VnIqiWsUHxu2wrglZgdmQXssUNQJXAo

To claim this, I am signing this object:

@mbrc12
mbrc12 / Error
Created June 1, 2018 11:42
Error gist
````
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for conf-0.1.1.0:
base-4.10.1.0 from stack configuration does not match >=4.6 && <4.8 (latest matching version is 4.7.0.2)
needed due to etanol-0.1.0.0 -> conf-0.1.1.0
In the dependencies for etanol-0.1.0.0:
base-4.10.1.0 from stack configuration does not match ==4.7.0.2 (latest matching version is 4.7.0.2)
needed since etanol is a build target.
@mbrc12
mbrc12 / fractal.hs
Last active October 26, 2020 17:44
fractal
{-
fractal : A fractal generator in haskell
Author : Mriganka Basu Roy Chowdhury
Install : Preferably (if you don't want cabal hell),
form a cabal sandbox and install JuicyPixels
and optparse-applicative. Then just
cabal exec -- ghc fractal.hs -O3
Please use -O3, as otherwise, the generation
==================== Tidy Core ====================
Result size of Tidy Core
= {terms: 548, types: 702, coercions: 164, joins: 4/13}
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
maxn :: Int
maxn = I# 1000000#
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule4 :: Addr#
@mbrc12
mbrc12 / primes.hs
Last active September 5, 2018 11:09
Eraosthenes's sieve with Haskell's Concurrency
{-# LANGUAGE TypeApplications #-}
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Monad
import Control.Parallel
import Data.Vector ((!))
import Debug.Trace
import System.Exit (die)
import qualified Data.Vector as V
@mbrc12
mbrc12 / init.el
Last active June 20, 2020 10:55
My current emacs config.
(setq inhibit-splash-screen t)
(tool-bar-mode -1)
(toggle-scroll-bar -1)
(add-to-list 'default-frame-alist
'(vertical-scroll-bars . nil))
(menu-bar-mode -1)
(show-paren-mode 1)
(setq-default tab-width 4)
(setq indent-tabs-mode nil)
@mbrc12
mbrc12 / Factorial.scala
Created April 12, 2020 09:15
Example code using Trampolines [Doesn't Work]
import scala.annotation.tailrec
sealed trait Trampoline[+A]
case class Done[A](x : A) extends Trampoline[A]
case class More[A](x : () => Trampoline[A]) extends Trampoline[A]
case class Act[A, B](x : Trampoline[B], f : (B => Trampoline[A])) extends Trampoline[A]
object Runner {
@tailrec
@mbrc12
mbrc12 / Branch.java
Created May 13, 2020 18:48
A Binary-Tree ADT in Java using the Visitor pattern
public class Branch<T> implements Tree<T>{
private T elem;
private Tree<T> left;
private Tree<T> right;
public Branch(T elem, Tree<T> left, Tree<T> right) {
this.elem = elem;
this.left = left;
this.right = right;
}
@mbrc12
mbrc12 / index.html
Created July 7, 2020 16:10
cljs/three.js test
<!-- /public/index.html -->
<html>
<script src = "/js/main.js"></script>
<script>window.onload = cjs1.main.main </script>
<style>
body { margin: 0; }
canvas { display: block; }
</style>
<body>
</body>