Anonymous user
Four is the number of letters in the ...: Difference between revisions
Four is the number of letters in the ... (view source)
Revision as of 15:40, 2 December 2021
, 2 years ago→{{header|Haskell}}: minor details
(→{{header|Haskell}}: added Haskell solution) |
(→{{header|Haskell}}: minor details) |
||
Line 577:
=={{header|Haskell}}==
Uses the solution [[Spelling_of_ordinal_numbers#Haskell]] and tying-the-knot technique to create the infinite sentence.
<lang haskell>import Data.Char
<lang haskell>sentence = start ++ foldMap add (zip [2..] $ tail $ words sentence)▼
where
start = "Four is the number of letters in the first word of this sentence, "
|