Closed neongreen closed 7 years ago
> format (fitLeft 5) "hel"
"hel"
I know about fitLeft
. I guess I should've explicitly clarified that “first 8 characters” was just an example and the actual use cases for “modify formatter's input” that I encounter don't have standard formatters for them.
Specifically, what I'm looking for is a function of this type:
(???) :: Format r (b -> r) -> (a -> b) -> Format r (a -> r)
Pushed to Hackage mapf
.
Wow. Thanks!
Just for the sake of example, say I want to create a formatter that would print first 8 characters of a string:
How would I go about it? I feel that the answer is obvious, but I can't figure it out.