code{-# LANGUAGE RecordWildCards #-}
import System.Random
import System.Process
import System.Environement
data F = F {x :: Int, y :: Int
,a :: Int, b :: Int} deriving (Show, Eq)
def = F {x=1920, y=1080, a=0, b=0}
interpret = foldl f def
where f (F {..}) 't' = F x (y `div` 2) a b
f (F {..}) 'b' = F x (y `div` 2) a (y `div` 2)
f (F {..}) 'r' = F (x `div` 2) y (x `div` 2) b
f (F {..}) 'l' = F (x `div` 2) y a b
ffmpeg (F {..}) n
= "ffmpeg -video_size " ++ show x
++ "x" ++ show y ++ " -framerate 25 -f x11grab -i :0.0+"
++ show a ++ "," ++ show b ++ " " ++ n ++ ".mp4"
main = do
[i] <- getArgs
name <- fmap (take 16) $ fmap (randomRs ('a','z')) newStdGen
spawnCommand (ffmpeg (interpret i) name) >>= waitForProcess
ghc error[1 of 1] Compiling Main ( rec.hs, rec.o )
rec.hs:21:1: error:
parse error (possibly incorrect indentation or mismatched brackets)
pls halp, im lost
21:1 is the line++ show a ++ "," ..
nevermind, I was using the wrong copy of the file
>import System.Environement
r8 my final prog{-# LANGUAGE RecordWildCards #-}
import System.Environment (getArgs)
import System.Process (spawnCommand, waitForProcess)
data F = F { x :: Int, y :: Int
, a :: Int, b :: Int } deriving (Show, Eq)
def = F {x=1920, y=1080, a=0, b=0}
interpret = foldl f def
where f (F {..}) 't' = F x (div y 2) a b
f (F {..}) 'b' = F x (div y 2) a (div y 2)
f (F {..}) 'r' = F (div x 2) y (div x 2) b
f (F {..}) 'l' = F (div x 2) y a b
f (F {..}) 's' = F x y a b
ffmpeg (F {..}) file
= foldl1 (++) [ "ffmpeg -video_size ", show x, "x", show y
, " -framerate 25 -f x11grab -i :0.0+"
, show a, ",", show b, " ", file
]
main = do
[p,n] <- getArgs
spawnCommand (ffmpeg (interpret p) n) >>= waitForProcess
What's the point of using a non-interpreted language for scripting?
>>55829446
whos dis semen demen
>>55831397
>What's the point of using a non-interpreted language for scripting?
haskell my first
and I don't know how to do folding in other languages
>>55831525
Russian grill who made a song video.
reverse search and you should find a forum with sauces