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
| #!/usr/bin/env stack | |
| -- stack --resolver lts-15.6 --install-ghc exec ghci --package wai | |
| {-# LANGUAGE ScopedTypeVariables, TypeApplications #-} | |
| import Network.Wai (Middleware) | |
| -- | This function doesn't look like much, but is pretty neat-o... | |
| h :: (Functor f) => (b -> c) -> (a -> f b) -> a -> f c | |
| h g f = fmap g . f |
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
| -- const has type: | |
| -- const :: a -> b -> a | |
| weirdConst :: b -> (forall a. a -> a) -> b | |
| weirdConst b _f = b | |
| blah :: Int | |
| blah = weirdConst 42 id | |
| -- blahBlah produces this compiler error: | |
| -- |
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
| #!/usr/bin/env stack | |
| {- stack | |
| --resolver lts-16.8 | |
| --install-ghc | |
| exec ghci | |
| -} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| import Prelude hiding (foldl, foldr) |
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
| import Data.Tree (Tree(Node, rootLabel, subForest)) | |
| paths :: Tree a -> [[a]] | |
| paths = \case | |
| Node { rootLabel, subForest } -> | |
| [rootLabel] : concatMap (map (rootLabel :) . paths) subForest |
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
| #!/usr/bin/env stack | |
| {- stack | |
| --resolver lts-16.8 | |
| --install-ghc | |
| exec ghci | |
| --package connection | |
| --package http-client | |
| --package http-client-tls | |
| -} |
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
| #!/usr/bin/env stack | |
| {- stack | |
| --resolver lts-16.26 | |
| --install-ghc | |
| exec ghci | |
| --package http-client | |
| -} | |
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} |
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
| #!/usr/bin/env stack | |
| {- stack | |
| --resolver lts-17.10 | |
| --install-ghc | |
| exec ghci | |
| --package aeson | |
| -- -ignore-dot-ghci -XDataKinds -XTypeApplications | |
| -} | |
| {-# LANGUAGE DataKinds #-} |
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
| #!/usr/bin/env stack | |
| {- stack | |
| --resolver lts-17.10 | |
| --install-ghc | |
| script | |
| --optimize | |
| -} | |
| -- This script demonstrates the synchrony of "Control.Exception.throwTo", in | |
| -- that calling the function is only synchronous until the asynchronous |
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
| ffmpeg -c:v libvpx -i "input.webm" -c:v prores_ks -pix_fmt yuva444p10le -metadata:s:v:0 alpha_mode="1" "output.mov" |