I hereby claim:
- I am tfausak on github.
- I am taylorfausak (https://keybase.io/taylorfausak) on keybase.
- I have a public key whose fingerprint is 1074 397C 56E3 4F1B FBDA 9D31 9C45 BE88 5CC1 680A
To claim this, I am signing this object:
{-# LANGUAGE ForeignFunctionInterface #-} | |
module Main (main) where | |
import Foreign.C.Types (CDouble (..)) | |
foreign import ccall safe "math.h sin" c_sin :: CDouble -> CDouble | |
foreign import ccall safe "public.h square" c_square :: CDouble -> CDouble | |
foreign import ccall safe "private.h half" c_half :: CDouble -> CDouble |
// http://taylor.fausak.me/2014/04/28/cloning-2048-in-haskell/ | |
import func Cocoa.rand | |
/* | |
Utilities | |
*/ | |
// TODO: Can this be generalized to allow anything addable? | |
func combine(array: Int[]) -> Int[] { |
#!/usr/bin/env ruby | |
pattern = /^```(.*)/ | |
capturing = false | |
language = '' | |
lines = {} | |
File.open(ARGV.shift).each_line do |line| | |
match = pattern.match(line) |
import Data.List (group) | |
import Data.Maybe (isJust) | |
import Data.Monoid ((<>)) | |
empty :: Int -> [Maybe Int] | |
empty = flip replicate Nothing | |
shift :: [Maybe Int] -> [Maybe Int] | |
shift v = take n (v' <> empty n) | |
where |
I hereby claim:
To claim this, I am signing this object:
https://github.com/tfausak/exercism-solutions/blob/master/haskell/binary/Binary.hs
module Binary
( toDecimal
) where
class Run | |
attr_reader :state | |
attr_reader :exception | |
attr_reader :time | |
def initialize(state, exception = nil, time = nil) | |
@state = state | |
@exception = exception | |
@time = time.nil? ? Time.now : time | |
end |
-- Purely Functional Data Structures | |
-- Exercise 5.1 | |
module Main | |
( Deque (Deque) | |
, empty | |
, isEmpty | |
, cons | |
, head | |
, tail |
# coding: utf-8 | |
require 'stringio' | |
module Erudite | |
class Outcome | |
attr_reader :result | |
attr_reader :output | |
def initialize(result, output) |
diff --git a/lib/active_interaction/base.rb b/lib/active_interaction/base.rb | |
index 64c70c3..9f5f61d 100644 | |
--- a/lib/active_interaction/base.rb | |
+++ b/lib/active_interaction/base.rb | |
@@ -168,7 +168,18 @@ module ActiveInteraction | |
attr_accessor filter.name | |
define_method("#{filter.name}?") { !public_send(filter.name).nil? } | |
- filter.default if filter.default? | |
+ initialize_default(filter) |