Skip to content

Instantly share code, notes, and snippets.

View emmanueldenloye's full-sized avatar

Emmanuel Denloye-Ito emmanueldenloye

  • New York, New York
View GitHub Profile
@emmanueldenloye
emmanueldenloye / gist:a86c08b1eaa8f3bd0c1a5cae7a7acb73
Created May 1, 2024 17:05
Simple Pact Parser (inlines let bindings)
{-# language OverloadedStrings #-}
import Data.Aeson (Value, decode)
import qualified Data.ByteString.Lazy.Char8 as BL
import Text.ParserCombinators.ReadP
import Control.Applicative hiding (many)
import Data.Char
import Data.Maybe (maybe)
data Expr = Json Value | StringLit String | Symbol String | Sexp [Expr] | Let [(String, Expr)] [Expr]
deriving (Show)