Skip to content

Instantly share code, notes, and snippets.

View ppetr's full-sized avatar
🤞
I may be slow to respond.

Petr ppetr

🤞
I may be slow to respond.
View GitHub Profile
{-# LANGUAGE TypeFamilies #-}
import Data.Functor
import Data.Functor.Compose
import qualified Data.Foldable as F
import Data.Knot
import qualified Data.Map as M
import qualified Data.Traversable as T
-- * Functor data types
-- ** Person'
@ppetr
ppetr / Parser.y
Last active December 10, 2015 23:59 — forked from anonymous/Parser.y
A small parser for a simple exercise functional language. Example: `(fix fact . \x . ifzero x 1 (mul x (fact (minus x 1)))) 10`.
{
module Parser where
import Data.Char
-- | Built-in functions in our language:
data BuiltFn
= Nat Integer -- ^ Natural number
deriving (Eq, Ord, Read, Show)