Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat Line as Text (but not vice versa) #213

Open
GregorySchwartz opened this issue Feb 10, 2017 · 2 comments
Open

Treat Line as Text (but not vice versa) #213

GregorySchwartz opened this issue Feb 10, 2017 · 2 comments

Comments

@GregorySchwartz
Copy link

GregorySchwartz commented Feb 10, 2017

onLines :: (Text -> Text) -> Line -> Line

Like onFiles but for Line. Helps with editing lines without
stdout . join . fmap (select . textToLines . FUNCTION . lineToText) $ stdin
and instead would be
stdout . fmap (onLines FUNCTION) $ stdin

@Gabriella439
Copy link
Owner

@GregorySchwartz The issue is that the Text -> Text function that you pass to onLines might return a Text with newlines (and therefore produce an invalid Line)

@GregorySchwartz
Copy link
Author

GregorySchwartz commented Feb 20, 2017

Ah, yes, that's true. I suppose a breaking way to solve that is to have Text.filter (not . isSpace) in the definition, but that would have to pass through the whole string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants