One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| import os | |
| import sys | |
| import argparse | |
| from glob import glob | |
| from itertools import chain | |
| import fontforge | |
| ADDITIONAL_LIGATURES = [ | |
| 'x.multiply', |
It's like creating the front end and back end of a compiler inside Haskell without the need of Template Haskell!
Write your DSL AST as a Free Monad, and then interpret the monad any way you like.
The advantage is that you get to swap out your interpreter, and your main code
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
| (use '[clojure.core.match :only [match]]) | |
| (defn evaluate [env [sym x y]] | |
| (match [sym] | |
| ['Number] x | |
| ['Add] (+ (evaluate env x) (evaluate env y)) | |
| ['Multiply] (* (evaluate env x) (evaluate env y)) | |
| ['Variable] (env x))) | |
| (def environment {"a" 3, "b" 4, "c" 5}) |
| {- Implementation of BST (binary search tree) | |
| Script is absolutly free/libre, but with no guarantee. | |
| Author: Ondrej Profant -} | |
| import qualified Data.List | |
| {- DEF data structure -} | |
| data (Ord a, Eq a) => Tree a = Nil | Node (Tree a) a (Tree a) | |
| deriving Show |