Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tmcgilchrist's full-sized avatar
👹

Tim McGilchrist tmcgilchrist

👹
View GitHub Profile
@tmcgilchrist
tmcgilchrist / lisp.rb
Created February 28, 2011 21:55 — forked from dahlia/lisp.rb
# 30 minutes Lisp in Ruby
# Hong Minhee <http://dahlia.kr/>
#
# This Lisp implementation does not provide a s-expression reader.
# Instead, it uses Ruby syntax like following code:
#
# [:def, :factorial,
# [:lambda, [:n],
# [:if, [:"=", :n, 1],
# 1,
(eval-after-load "haskell-mode"
;; Replace the haskell-mode version with this version,
;; this will line up all imports as if they're all qualified
;; eg this
;;
;; import Data.Monoid
;; import Data.Text
;;
;; becomes
;;
class Show a where
    show :: a -> String

instance Show Int where
    show = ... -- provided by default

show 1 
@tmcgilchrist
tmcgilchrist / gist:11e548b4c3d77d33002d
Created November 10, 2014 21:34
OCaml Project Ideas
General musing on some projects I'd like to try writing with OCaml
- database bindings for MySQL that include proper type checking and embedding sql ala pgocaml
- general application that queries webservice, does DB stuff and then does webservice requests (eg Antiquarian)
- functor/monad/monoid library
- bindings for libyaml
- bindings for https://github.com/joyent/libuv Cross platform async IO
- library for connecting to Riak
- lightwieght monadic regions implementation
- property based testing library
> cat ~/.sbt/0.13/plugins/plugins.sbt
resolvers += Resolver.sonatypeRepo("snapshots")
addSbtPlugin("org.ensime" % "ensime-sbt" % "0.1.5-SNAPSHOT")
> sbt gen-ensime
[info] Loading global plugins from /Users/tim/.sbt/0.13/plugins
[info] Loading project definition from /Users/tim/code/scala/introduction-to-fp-in-scala/project
[info] Set current project to introduction-to-fp-in-scala (in build file:/Users/tim/code/scala/introduction-to-fp-in-scala/)
[error] Not a valid command: gen-ensime
```
___
| |
| |
-------------------
-------------------
| ___ | ___ |
| | | | | | | | |
| |-+-| | |-+-| |
| |_|_| | |_|_| |
@tmcgilchrist
tmcgilchrist / stack.ml
Created May 18, 2014 22:24
Stack Data Type from Purely Function Data Structures.
module type Stack =
sig
type 'a t
val empty : 'a t
val isEmpty : 'a t -> bool
val cons : 'a -> 'a t -> 'a t
val head : 'a t -> 'a
val tail : 'a t -> 'a t
end