just use GHC for OSX https://ghcformacosx.github.io
the rest of these directions are preserved for historical purposes
xcode-select --install ; brew tap homebrew/versions ; brew tap homebrew/dupes \
{-# LANGUAGE DataKinds, TemplateHaskell, TypeFamilies, QuasiQuotes #-} | |
import TICTACTOE | |
game :: ([tq| x o x | |
o o x | |
☐ ☐ x |]) | |
game = (?) |
I know when milk does flies contain; | |
I know men by their bravery; | |
I know fair days from storm and rain; | |
And what fruit apple-trees supply; | |
And from their gums the trees descry; | |
I know when all things smoothly flow; | |
I know who toil or idly lie; | |
All things except myself I know. | |
{-# Language GeneralizedNewtypeDeriving #-} | |
{-# Language OverloadedStrings #-} | |
import Data.Monoid | |
import Text.Blaze.Html.Renderer.Text | |
import qualified Text.Blaze.Html5 as H | |
import qualified Text.Blaze.Html5.Attributes as A | |
import Text.Blaze.Html ((!), Html) | |
import Control.Monad.Writer | |
import Control.Monad.Identity |
[alias] | |
l = log -10 --pretty=tformat:'%C(yellow)%ad %Cred%h%C(bold blue)%d%Creset %s' --date=short | |
l2 = log -10 --pretty=tformat:'%C(yellow)%ad %Cred%h%C(bold blue)%d%Creset %s %Cgreen(%an)%Creset' --date=short | |
l3 = log -10 --pretty=tformat:'%Cred%h%C(bold blue)%d%Creset %s %C(yellow)%cr %Cgreen%an%Creset' --date=relative | |
l4 = log -10 --pretty=tformat:'%Cred%h %C(yellow)%ad %Cgreen%an%C(bold blue)%d %Creset%s' --date=short | |
lg = log -10 --graph --pretty=tformat:'%C(yellow)%ad %Cred%h%C(bold blue)%d%Creset %s' --date=short | |
lg2 = log -10 --graph --pretty=tformat:'%C(yellow)%ad %Cred%h%C(bold blue)%d%Creset %s %Cgreen(%an)%Creset' --date=short | |
lg3 = log -10 --graph --pretty=tformat:'%Cred%h%C(bold blue)%d%Creset %s %C(yellow)%cr %Cgreen%an%Creset' --date=relative | |
lg4 = log -10 --graph --pretty=tformat:'%Cred%h %C(yellow)%ad %Cgreen%an%C(bold blue)%d %Creset%s' --date=short | |
s = status -sb |
just use GHC for OSX https://ghcformacosx.github.io
the rest of these directions are preserved for historical purposes
xcode-select --install ; brew tap homebrew/versions ; brew tap homebrew/dupes \
-- | Simple in-process key/value cache | |
-- | |
-- Of course, for really simple stuff you could probably use unsafeInterleaveIO | |
module Cache (Cache, newCache, fromCache) where | |
import Control.Monad (void) | |
-- Could also use STM instead | |
import Control.Concurrent (forkIO, Chan, newChan, readChan, writeChan, MVar, newEmptyMVar, putMVar, takeMVar) |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE DataKinds#-} | |
{-# LANGUAGE KindSignatures#-} | |
module RedBlackTree where | |
data Nat = Zero | Succ Nat deriving (Eq, Ord, Show) | |
type One = Succ Zero |
Demonstrates the use of Racket's custodians and namespaces to create enough isolation to "reboot" programs without restarting the whole of Racket, including possibly recompiling and reloading code.
To experiment with this:
$ racket ~/src/racket-experiments$ racket
Welcome to Racket v5.3.1.4.
-> (require "reloader.rkt")
-> (load-and-foo)
Starting worker...
test-mod: "foo"