@@ -0,0 +1,32 @@
1+-- Convert the input file to camel case and write to stdout
3+import Data.Maybe (fromJust, isJust)
4+import System.Environment (getArgs)
5+import System.IO (Handle, IOMode(..), openFile, stdout)
7+import qualified Streamly.Prelude as S
8+import qualified Streamly.Internal.FileSystem.Handle as FH
10+camelCase :: Handle -> Handle -> IO ()
16+ $ S.scanl' step (True, Nothing)
21+ step (wasSpace, _) x =
22+ if x == 0x0a || x >= 0x41 && x <= 0x5a
24+ else if x >= 0x61 && x <= 0x7a
25+ then (False, Just $ if wasSpace then x - 32 else x)
30+ name <- fmap head getArgs
31+ src <- openFile name ReadMode