Reverse the gender of a string: Difference between revisions

Content added Content deleted
m (-1)
(→‎{{header|J}}: Added a fully optimised Haskell version, with minimal space and time complexity, and fairly compact source code.)
Line 94: Line 94:
She was a soul stripper. She took my heart!
She was a soul stripper. She took my heart!
</pre>
</pre>

=={{header|Haskell}}==

We can optimise the time and space complexity of this computation by careful selection of the source and target languages (not specified in the task description, although the example appears to be drawn from some kind of Anglo Saxon dialect).

Sino-Tibetan dialects generally work well here. If we choose any standard transcription of Modern Standard Chinese (such as Pinyin or IPA) or more or less any written sample example of pre 19c literary Chinese, we can reduce the entire computation down to a very pleasing intersection of code golf with fully optimized space and time performance:


<lang haskell>id</lang>



=={{header|J}}==
=={{header|J}}==