This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
-- WARNING! This is very bad, quickly-written code, and should not be | |
-- trusted to do anything right! It does not support writing, and still | |
-- has several problems even for reading. Also it's ugly and bad. | |
import qualified Data.ByteString as BSS | |
import Data.ByteString.Lazy (ByteString) | |
import qualified Data.ByteString.Lazy as BS | |
import Data.Char (isDigit) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Data.List (nub) | |
import MonadLib | |
import UI.TCOD.Console | |
import UI.TCOD.Console.Types | |
import UI.TCOD.Color | |
type Pt = (Int, Int) | |
type St = (Pt, [Pt]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A basic intepreter for the untyped lambda calculus | |
enum Term | |
{ Num(int) | |
, Var(~str) | |
, Lam(~str, ~Term) | |
, App(~Term, ~Term) | |
, Let(~str, ~Term, ~Term) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; guile-utf8.scm | |
;; A quickly hacked together set of functions to turn | |
;; utf-8-encoded text (which Guile sees as raw bytes) into | |
;; ASCII-encoded HTML, with a few other functions for | |
;; getting the code values out of a UTF-8 string. | |
;; anon-let is a hacky macro to create a new scope while | |
;; allowing definitions within it to bind in its enclosing | |
;; scope. It also allows define-local which only defines | |
;; within that scope. It is used here to close over constants |
NewerOlder