Skip to content

Instantly share code, notes, and snippets.

View tmcgilchrist's full-sized avatar
👹

Tim McGilchrist tmcgilchrist

👹
View GitHub Profile
@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
class Show a where
    show :: a -> String

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

show 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
;;
@tmcgilchrist
tmcgilchrist / hackage_release.md
Last active May 24, 2017 00:18
Release the hounds aka Push package to Hackage

Releasing to Hackage

  1. Create PR bumping version number
  2. Ensure it's building on CI
  3. Bump version in *.cabal file
  4. Commit new version to repo and push
  5. cabal sdist to generate a package
  6. cabal upload dist/pkg-x.y.x.tar.gz
  7. tag repo with this version
  8. Upload haddock changes
@tmcgilchrist
tmcgilchrist / Battleship.lhs
Created July 30, 2017 22:51 — forked from ChrisPenner/Battleship.lhs
Hit! You sunk my Adjunction!
Today we'll be looking into Kmett's
[adjunctions](http://hackage.haskell.org/package/adjunctions) library,
particularly the meat of the library in Data.Functor.Adjunction.
This post is a literate haskell file, which means you can load it right up in
ghci and play around with it! Like any good haskell file we need half a dozen
language pragmas and imports before we get started.
> {-# language DeriveFunctor #-}
> {-# language TypeFamilies #-}
@tmcgilchrist
tmcgilchrist / prismatic.hs
Created November 27, 2018 04:11 — forked from parsonsmatt/prismatic.hs
I figured out a nice way to pluck exceptions out of a constraint!
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
```
OCaml compilation pipeline
┌────────────────┐
│ │
│ Source code │