Standard ML (MLton), 92(削除) 92 (削除ここまで) 77 bytes
implode o foldr(fn(a,b:: #" "::r)=>b::a:: #" "::r|(a,r)=>a::r)[#" "]o explode
Try it online! Based on xnor's Haskell solution .
###Previous 92 byte version
fun f(a::b:: #" "::r)=b::a:: #" "::f r|f(x::r)=x::f r|f r=r
fun$s=implode(f(explode(s^" ")))
Try it online! Example usage: $ "Flippign Lettesr Aroudn" yields "Flipping Letters Around ".
###Ungolfed
fun f (a :: b :: #" " :: r) = b :: a :: #" " :: f r
| f (x :: r) = x :: f r
| f r = r
fun g s = implode (f (explode (s ^ " ")))
[Try it online!][TIO-jbpmc805] [TIO-jbpmc805]: https://tio.run/##fU67CgIxEOzzFUO0SAp/4MDCxspvUCKXHIG82OQkhf8eE05EG6fY2R1mmM3eHbwrMbRm1gADoTBNuI@x4@CDSeK4KepbNiAGPDv/QNRPpv6xbSB0GzE2uhfkflifXJw1RH9F1/eece2dXErZHsrh1n2JbChiD352NiW7BFx0KToTThTXOXDZXg "Standard ML (MLton) – Try It Online"
Standard ML (MLton), 92 bytes
fun f(a::b:: #" "::r)=b::a:: #" "::f r|f(x::r)=x::f r|f r=r
fun$s=implode(f(explode(s^" ")))
Try it online! Example usage: $ "Flippign Lettesr Aroudn" yields "Flipping Letters Around ".
###Ungolfed
fun f (a :: b :: #" " :: r) = b :: a :: #" " :: f r
| f (x :: r) = x :: f r
| f r = r
fun g s = implode (f (explode (s ^ " ")))
[Try it online!][TIO-jbpmc805] [TIO-jbpmc805]: https://tio.run/##fU67CgIxEOzzFUO0SAp/4MDCxspvUCKXHIG82OQkhf8eE05EG6fY2R1mmM3eHbwrMbRm1gADoTBNuI@x4@CDSeK4KepbNiAGPDv/QNRPpv6xbSB0GzE2uhfkflifXJw1RH9F1/eece2dXErZHsrh1n2JbChiD352NiW7BFx0KToTThTXOXDZXg "Standard ML (MLton) – Try It Online"
Standard ML (MLton), (削除) 92 (削除ここまで) 77 bytes
implode o foldr(fn(a,b:: #" "::r)=>b::a:: #" "::r|(a,r)=>a::r)[#" "]o explode
Try it online! Based on xnor's Haskell solution .
###Previous 92 byte version
fun f(a::b:: #" "::r)=b::a:: #" "::f r|f(x::r)=x::f r|f r=r
fun$s=implode(f(explode(s^" ")))
Try it online! Example usage: $ "Flippign Lettesr Aroudn" yields "Flipping Letters Around ".
###Ungolfed
fun f (a :: b :: #" " :: r) = b :: a :: #" " :: f r
| f (x :: r) = x :: f r
| f r = r
fun g s = implode (f (explode (s ^ " ")))
[Try it online!][TIO-jbpmc805] [TIO-jbpmc805]: https://tio.run/##fU67CgIxEOzzFUO0SAp/4MDCxspvUCKXHIG82OQkhf8eE05EG6fY2R1mmM3eHbwrMbRm1gADoTBNuI@x4@CDSeK4KepbNiAGPDv/QNRPpv6xbSB0GzE2uhfkflifXJw1RH9F1/eece2dXErZHsrh1n2JbChiD352NiW7BFx0KToTThTXOXDZXg "Standard ML (MLton) – Try It Online"
Standard ML (MLton), 92 bytes
fun f(a::b:: #" "::r)=b::a:: #" "::f r|f(x::r)=x::f r|f r=r
fun$s=implode(f(explode(s^" ")))
Try it online! Example usage: $ "Flippign Lettesr Aroudn" yields "Flipping Letters Around ".
###Ungolfed
fun f (a :: b :: #" " :: r) = b :: a :: #" " :: f r
| f (x :: r) = x :: f r
| f r = r
fun g s = implode (f (explode (s ^ " ")))
[Try it online!][TIO-jbpmc805] [TIO-jbpmc805]: https://tio.run/##fU67CgIxEOzzFUO0SAp/4MDCxspvUCKXHIG82OQkhf8eE05EG6fY2R1mmM3eHbwrMbRm1gADoTBNuI@x4@CDSeK4KepbNiAGPDv/QNRPpv6xbSB0GzE2uhfkflifXJw1RH9F1/eece2dXErZHsrh1n2JbChiD352NiW7BFx0KToTThTXOXDZXg "Standard ML (MLton) – Try It Online"