Skip to content

Instantly share code, notes, and snippets.

@danidiaz
Last active August 29, 2015 14:09
Show Gist options
  • Save danidiaz/243582b0b034484de29f to your computer and use it in GitHub Desktop.
Save danidiaz/243582b0b034484de29f to your computer and use it in GitHub Desktop.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import System.Process.Streaming
import System.Exit
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy.Char8 as S
import Pipes.ByteString (toLazyM)
main :: IO ()
main = do
(code, result) <- execute (pipeo (fromFold toLazyM)) (shell "ls -l")
S.putStr result
exitWith code
@istathar
Copy link

That's very nice, obviously :) I don't understand toLazy there; result is a strict ByteString.... oh, not it's not. You dropped to .Lazy. Yeah. You see, that's a non-starter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment