Skip to content

Instantly share code, notes, and snippets.

@nuttycom
nuttycom / climbing-at-lambdaconf.md
Last active June 6, 2016 07:22
Climbing At LambdaConf

Climbing At Lambdaconf

Boulder is home to some of the best rock climbing in the nation. World-class multipitch traditional climbing in Eldorado Canyon, the high quality granite along Boulder Creek, and the unmistakable Flatirons draw climbers from all over the world to our town. Boulder is also home to three top-notch climbing gyms where you can train alongside the masters of the sport. So why not get on the rocks a little while you're here?

Schedule

Three climbing events are currently planned for the week of LambdaConf. Two of these events will be at indoor gyms in Boulder; the third, (for experts only, self-guided, bring your own gear) will be on the amazing granite of the Dome in Boulder Canyon, which is located a short bike ride from downtown.

@nuttycom
nuttycom / Test.hs
Created March 5, 2016 05:26
Deriving FAIL
module Test where
import Data.Thyme.Clock as C
data X = X { _t :: C.UTCTime } deriving Show
nuttycom@lights: ~/personal/aftok (auction_tests|MERGING)$ stack build
aftok-0.1: configure
Configuring aftok-0.1...
aftok-0.1: build
Building aftok-0.1...
Preprocessing library aftok-0.1...
[ 1 of 11] Compiling Aftok.Util.Http ( lib/Aftok/Util/Http.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Util/Http.o )
[ 2 of 11] Compiling Aftok.Util ( lib/Aftok/Util.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Util.o )
[ 3 of 11] Compiling Aftok.Interval ( lib/Aftok/Interval.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Interval.o )
[ 4 of 11] Compiling Aftok.Types ( lib/Aftok/Types.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Types.o )
nuttycom@lights: ~/personal/aftok (master)$ stack setup -v
Version 0.1.2.0, Git revision 65246552936b7da4b64b38372feac903d96a8911
2016-02-19 03:51:47.283199: [debug] Checking for project config at: /Users/nuttycom/personal/aftok/stack.yaml @(stack-0.1.2.0:Stack.Config src/Stack/Config.hs:496:9)
2016-02-19 03:51:47.284473: [debug] Loading project config file stack.yaml @(stack-0.1.2.0:Stack.Config src/Stack/Config.hs:519:13)
2016-02-19 03:51:47.295753: [debug] Run process: ghc --info @(stack-0.1.2.0:System.Process.Read src/System/Process/Read.hs:254:3)
2016-02-19 03:51:48.030858: [debug] Downloading from https://www.haskell.org/ghc/dist/7.10.2/ghc-7.10.2-x86_64-apple-darwin.tar.bz2 to /Users/nuttycom/.stack/programs/x86_64-osx/ghc-7.10.2.tar.bz2 ... @(stack-0.1.2.0:Stack.Setup src/Stack/Setup.hs:682:5)
Already downloaded.
2016-02-19 03:51:48.034532: [debug] Unpacking /Users/nuttycom/.stack/programs/x86_64-osx/ghc-7.10.2.tar.bz2 @(stack-0.1.2.0:Stack.Setup src/Stack/Setup.hs:569:9)
2016-02-19 03:51:48.034665: [
@nuttycom
nuttycom / gist:2cbf2b646ecb2c625e8f
Created October 28, 2015 15:35
Purescript import woes
nuttycom@lights: ~/work/xip $ pulp build
* Building project in /Users/nuttycom/work/xip
psc: No files found using pattern: src/**/*.js
Error found:
Error at /Users/nuttycom/work/xip/src/Main.purs line 7, column 1 - line 9, column 1:
Cannot declare "LT" since another declaration of that name was imported from Prelude
Possible fix: hide "LT" when importing Prelude:
import Prelude hiding (LT)
sealed trait Request[A]
case class PostTweet[A](userId: UserId, tweet: Tweet, a: => A) extends Request[A]
case class GetTweets[A](userId: UserId, cont: List[Tweet] => A) extends Request[A]
case class GetUserName[A](userId: UserId, cont: UserName => A) extends Request[A]
case class GetPhoto[A](userId: UserId, cont: UserPhoto => A) extends Request[A]
@nuttycom
nuttycom / gist:e4327adc21c840d77287
Created April 30, 2015 16:04
Capturing existential typeclasses in Scala
scala> trait Pet[A] {
| def blah(a: A): A
| }
defined trait Pet
scala> object IntPet extends Pet[Int] {
| def blah(i: Int) = i
| }
defined module IntPet
@nuttycom
nuttycom / overlapping_f-algebrae.md
Last active August 29, 2015 14:19
Overlapping F-algebras in Haskell

On a number of occasions, I've encountered situations where I've wanted to be able to define multiple data types that referenced the same data constructors, without requiring wrapping and unwrapping; while lenses make traversing these sorts of nested data structures easy, I still am not completely comfortable with them, so I went looking for something a bit simpler. The solution that came to me was this:

data X = X
data Y = Y
data Z = Z

-- An algebra over X and Y
data XYAlg a = XYAlg (X -> a) (Y -> a)
require 'flow/common/function'
class Maybe
include Enumerable
def self.just(v)
Maybe.new(->(if_nothing, if_just) { if_just.call(v) })
end
def self.nothing
➜ quixotic git:(master) ✗ nix-shell --arg networkBitcoin 'import /home/nuttycom/oss/network-bitcoin {}'
[nix-shell:~/projects/quixotic]$ eval "$configurePhase"
configure flags: --enable-split-objs --disable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests --ghc-option=-optl=-Wl,-rpath=/nix/store/jg1r4ghgyc97y84dnridx0wx4pq98g14-haskell-quixotic-ghc7.8.4-0.1-shared/lib/ghc-7.8.4/quixotic-0.1
Warning: quixotic.cabal: This package requires at least Cabal version 1.20
Configuring quixotic-0.1...
Setup: At least the following dependencies are missing:
configurator ==0.2.*, optparse-applicative >=0.9.0 && <0.10
[nix-shell:~/projects/quixotic]$ cat shell.nix
# This file was auto-generated by cabal2nix. Please do NOT edit manually!