Created
March 11, 2018 10:18
-
-
Save anacrolix/32f55a87c47d7fb23632e49b9be8a147 to your computer and use it in GitHub Desktop.
what have i made
This file contains hidden or 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
data Transcode = Transcode | |
{ inputUrl :: ByteString | |
, ffmpegOpts :: [ByteString] | |
, format :: ByteString | |
} | |
getOutputName :: ByteString -> [ByteString] -> ByteString -> ByteString | |
getOutputName i opts f = | |
(C.pack . List.map toLower . C.unpack . hex $ hashStrings (i : opts)) <> "." <> | |
f | |
target :: Transcode -> OpId | |
target t = C.unpack $ getOutputName .* inputUrl $. ffmpegOpts $. format .$ t | |
infixr 9 .$ | |
a .$ b = (\c -> c (a b), b) | |
infixr 8 $. | |
a $. (b, c) = (\d -> b $ d $ a c, c) | |
infixr 7 .* | |
a .* (b, c) = b a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment