Skip to content

Instantly share code, notes, and snippets.

View bitemyapp's full-sized avatar
🐺
aroo

Chris A. bitemyapp

🐺
aroo
View GitHub Profile
# Install a local copy of Hoogle (OS X, HP)
# Download
cd
cabal unpack hoogle
cd hoogle-4.2.26/
# Build
cabal sandbox init
cabal install -j --dependencies-only
total
threeAintEven : Even 3 -> _|_
threeAintEven (evenS e) with (e)
| (evenS _) impossible
| (evenZ) impossible
threeAintEven evenZ impossible

Optic Cookbook

The imports for building the various field-oriented optics are pretty minimal. It's not until you make a Getter or a Fold that you need to look outside of base.

This cookbook only covers the field oriented optics and not the constructor oriented ones. If you want to build a Prism or an Iso without a lens dependency, you should copy the definition of lens' prism and iso combinators and add a profunctors dependency to your project. Those two combinators are quite self-contained.

http://www.jerf.org/iri/post/2908
http://mwotton.github.com/hs_gbu/
http://reddit.com/r/haskell/comments/y6i7d/do_we_have_real_world_examples_of_where_static/
http://reddit.com/r/haskell/comments/12e3a0/the_good_the_bad_and_the_ugly_haskell_in/
http://blog.codersbase.com/2010/09/composability-laziness-testing-and.html
https://www.fpcomplete.com/user/imalsogreg/functional-programming-elevator-pitch
http://evincarofautumn.blogspot.com/2012/07/so-i-write-compilers-for-living-now.html
http://www.reddit.com/r/haskell/comments/2gz7s1/please_point_me_at_an_eloquent_paper_or_post_on/
@bitemyapp
bitemyapp / State.hs
Last active August 29, 2015 14:07 — forked from YoEight/State.hs
{-# LANGUAGE RankNTypes #-}
newtype State s a = State { runState :: forall r. s -> (a -> s -> r) -> r }
stateReturn :: a -> State s a
stateReturn = undefined
stateMap :: (a -> b) -> State s a -> State s b
stateMap = undefined
{-# LANGUAGE RankNTypes #-}
newtype State s a = State { runState :: forall r. s -> (a -> s -> r) -> r }
stateReturn :: a -> State s a
stateReturn a = State $ \s k -> k a s
stateMap :: (a -> b) -> State s a -> State s b
stateMap f (State sa) = State $ \s kb -> sa s (kb . f)
@bitemyapp
bitemyapp / parser.clj
Last active August 29, 2015 14:07 — forked from yogthos/parser.clj
(ns parser)
(defn read-char [rdr]
(let [ch (.read rdr)]
(if-not (== -1 ch) (char ch))))
(def expr-tags
{:if #(str "if tag args: " (clojure.string/join ", " %1))})
(defn expr-tag [{:keys [tag-name args] :as tag} rdr]
@bitemyapp
bitemyapp / foo.patch
Last active August 29, 2015 14:08 — forked from jlouis/foo.patch
diff --git a/apps/flake/src/flake_harness.erl b/apps/flake/src/flake_harness.erl
index 0657f03..6980cb3 100644
--- a/apps/flake/src/flake_harness.erl
+++ b/apps/flake/src/flake_harness.erl
@@ -18,33 +18,35 @@
-author ('Dietrich Featherston <d@boundary.com>').
-export ([
- generate/1,
- generate/2,