Skip to content

Instantly share code, notes, and snippets.

@jiamo
jiamo / Cartesian_product2.hs
Last active May 27, 2018 17:31
high order function transform simple 2
module Cartesian_product2 where
import Prelude hiding(product)
-- introduce mapa
map' :: (b->a) -> [b] -> [a]
map' g l = foldr' f [] l where
f x y = (g x) : y
foldr' :: (a -> b -> b) -> b -> [a] -> b
foldr' f z [] = z
@jiamo
jiamo / cartesian_product1.hs
Last active May 25, 2018 17:35
high order function transform example 1
module Cartesian_product1 where
import Prelude hiding(product)
product1 [] = [[]]
product1 (xs:xss) =
h xs (product1 xss) where
h [] xss = []
h (x : xs) xss =
map (x:) xss ++ h xs xss
@jiamo
jiamo / build_mediainfo.sh
Last active May 25, 2018 17:39
Build mediainfo ELF for aws lambda
cd ~/
apt-get install git automake autoconf libtool pkg-config make g++ zlib1g-dev libcurl4-gnutls-dev
git clone https://github.com/MediaArea/ZenLib.git
git checkout v0.4.37
cd ZenLib/Project/GNU/Library
./autogen.sh
./configure --enable-static
make -j4