This file contains 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 Untyped.Context where | |
type Context = [String] | |
mkContext :: Context | |
mkContext = [] | |
bindVarName :: Context -> String -> Context | |
bindVarName ctx x = x : ctx |
This file contains 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
(defn parse-necronomemoticon | |
[s] | |
(let [rdr (BufferedReader. (StringReader. s)) | |
expr (->> (line-seq rdr) (map seq) first)] | |
(match [expr] | |
[([\( \; \, \; \)] :seq)] :evil | |
:else :failure))) |
This file contains 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
class Semigroup a where | |
mappend :: a -> a -> a | |
class Semigroup a => Monoid a where | |
mempty :: a | |
mconcat :: [a] -> a | |
mconcat = foldr mappend mempty | |
instance Semigroup Int where |
This file contains 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
(add-hook 'haskell-mode-hook (lambda () (run-with-idle-timer (seconds-to-time 1) t 'ghc-show-type))) |
This file contains 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 #-} | |
module Parsing.Examples where | |
import Data.Attoparsec.Text | |
import Control.Applicative | |
something :: Parser (String, Maybe String) | |
something = | |
do a <- manyTill anyChar (string "--") <|> many anyChar |
This file contains 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
(ns dsls.core) | |
(def x 4) | |
(comment | |
"Delaying evaluation with Quote" | |
x | |
'x |
This file contains 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
∴ > ab -n 1000000 -c 1000 -p /dev/null http://localhost:3000/debug-count | |
This is ApacheBench, Version 2.3 <$Revision: 1430300 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Completed 100000 requests | |
Completed 200000 requests | |
Completed 300000 requests | |
Completed 400000 requests |
This file contains 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
(defn player | |
[msg table] | |
(go (loop [] | |
(let [ball (<! table)] ;; the ball was hit to this player | |
(.log js/console msg) | |
(<! (timeout 100)) ;; wait 100msecs | |
(>! table (update-in ball [:hits] inc)) ;; hit the ball back | |
(recur))))) | |
(defn game |
This file contains 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
SELECT ([SUBJECTID], [NUM_BDI_TIMEPOINTS]) | |
FROM [SUBJECTIDENTIFIERS] | |
INNER JOIN (SELECT [SUBJECTID], count([BDI_TP]) AS [NUM_BDI_TIMEPOINTS] | |
FROM [BDIS_OUTPUT] | |
WHERE ((([BDI_TP] COLLATE Latin1_General_CS_AS) | |
LIKE | |
(N'Y%' COLLATE Latin1_General_CS_AS) ESCAPE N'\\')) | |
GROUP BY [SUBJECTID]) AS [T1] | |
ON ([T1].[SUBJECTID] = [SUBJECTIDENTIFIERS].[SUBJECTID]) |
This file contains 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
require 'java' | |
require 'jbundler' | |
require 'stunted' | |
java_import 'clojure.lang.Ref' | |
java_import 'clojure.lang.LockingTransaction' | |
java_import 'java.util.concurrent.Executors' | |
java_import 'java.util.concurrent.Callable' | |
module CoreBridge |