Skip to content

Instantly share code, notes, and snippets.

@mgsloan
mgsloan / gist:6050213
Last active December 20, 2015 01:39 — forked from wcauchois/gist:6050119
GeocodeResponse latLng <- callJsonEndpoint $ GeocodeEndpoint targetAddress False
let venuesTrendingEndpoint = VenuesTrendingEndpoint latLng Nothing Nothing `authorizeWith` creds
VenuesTrendingResponse venues <- callJsonEndpoint venuesTrendingEndpoint
let printVenue v = putStrLn $ "- " ++ name v
mapM_ printVenue venues
#!/bin/bash
ext=$1
rsync -aL --delete ~/fpco/ide/ ~/build/fpco-$ext/
cd ~/build/fpco-$ext
perl -i -pe "s~/fpco/ide/~/build/fpco-$ext/~g;" \
.hsenvs/*/.hsenv/bin/activate \
@mgsloan
mgsloan / Bar.hs
Last active December 10, 2015 01:48 — forked from anonymous/Bar.hs
module Bar where
bar = answer * 20
@mgsloan
mgsloan / blah.hs
Created April 7, 2012 19:35
Lined up variant
zipProducers :: Producer a m r -> Producer b m r -> Producer (a, b) m r
zipProducers (Pure r) _ = return r
zipProducers _ (Pure r) = return r
zipProducers (M m1) (M m2) = lift m1 >>= \p1 -> lift m2 >>= \p2 -> zipProducers p1 p2
zipProducers (M m1) p2 = lift m1 >>= \p1 -> zipProducers p1 p2
zipProducers p1 (M m2) = lift m2 >>= \p2 -> zipProducers p1 p2
zipProducers (Await f1) (Await f2) = zipProducers (f1 ()) (f2 ())
zipProducers (Await f1) p2 = zipProducers (f1 ()) p2