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
pub fn combine_all_option<T>(xs: &Vec<T>) -> Option<T> | |
where | |
T: Semigroup + Clone, | |
{ | |
xs.iter().skip(1).fold( | |
xs.first().map(|v| v.clone()), | |
|acc, next| acc.map(|v| v.combine(next)), | |
) | |
} |
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
# From a fresh install of Debian | |
sudo apt-get install ruby rubygems # Need ruby to use fpm | |
sudo gem1.8 install fpm --no-ri --no-rdoc | |
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz | |
tar -zxvf ruby-1.9.3-p484.tar.gz | |
cd ruby-1.9.3-p484 | |
rm -rf /tmp/ruby193 |