Skip to content

Instantly share code, notes, and snippets.


Sameer Kolhar kolharsam

View GitHub Profile
kolharsam / string-conversions.hs
Created May 29, 2021 — forked from dino-/string-conversions.hs
A handy illustration of converting between String, Text and ByteString in Haskell
View string-conversions.hs
#! /usr/bin/env stack
-- stack --resolver lts-12.14 script
{-# LANGUAGE OverloadedStrings #-}
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
kolharsam / js_parser.clj
Created May 27, 2020 — forked from borkdude/js_parser.clj
Parse JavaScript in Clojure using the Google Closure Compiler
View js_parser.clj
"exec" "clojure" "-Sdeps" "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.520\"}}}" "$0" "$@"
;; running js_parser.clj "function foo(x) { var y = x + 1; }" will print:
;; [{:type :function, :name "foo", :body [{:variable-statement [{:lvalue "y", :initializer {:type :binary-op, :left "x", :operator "+", :right "1"}}]}], :params ["x"]}]
kolharsam /
Created May 22, 2020 — forked from kachayev/
Parsing CSS file with monadic parser in Clojure
kolharsam / monads.clj
Created May 17, 2020 — forked from lispyclouds/monads.clj
Monads, simple made easier
View monads.clj
; A simple demo of monadic composition of side effects
; Program to take 3 nubers as input and print their sum.
(defn read-and-add!
(print "Enter a number: ")
(+ prev (do (flush)
(Integer/parseInt (read-line)))))
(defn bind
kolharsam /
Created May 9, 2020 — forked from smarr/
Truffle: Languages and Material