2 ms·
Yeah, in Haskell I'd probably have done something like dropWhile (not . T.isPrefixOf "+++") >>> \case [] -> return () (line:lines) -> do
by dllthomas 12y ago
Yeah, in Haskell I'd probably have done something like
dropWhile (not . T.isPrefixOf "+++") >>> \case
[] -> return ()
(line:lines) -> do
header env line
modified env 0 lines
edited to add: code above assumes LambdaCase and OverloadedStrings extensions, and that you've imported Data.Text qualified as T
- thinkpad20 12y agolambdacase is one of my favorite extensions :D
- dllthomas 12y agoI really like ScopedTypeVariables