Jump to content

Old lady swallowed a fly: Difference between revisions

Frege and Haskell: concatMap is much more elegant
(Added BBC BASIC)
(Frege and Haskell: concatMap is much more elegant)
Line 736:
 
{{trans|Haskell}}
{{Works with|Frege|3.2023.113888-g4e22ab6}}
 
Nearly identical to the Haskell. Only the first line and last line of the program had to be changed atis alldifferent.
 
<lang frege>module OldLady where
Line 778:
 
song :: [String]
song = intercalate [""] $ mapconcatMap verse $ tail $ reverse $ tails animals
 
main _ = printStrputStr $ unlines song</lang>
 
=={{header|Go}}==
Line 822:
 
=={{header|Haskell}}==
 
<lang haskell>#!/usr/bin/runhaskell
{{Works with|GHC|7.8.3}}
 
<lang haskell>#!/usr/bin/env runhaskell
 
import Data.List
Line 860 ⟶ 863:
 
song :: [String]
song = intercalate [""] $ mapconcatMap verse $ tail $ reverse $ tails animals
 
main = putStr $ unlines song</lang>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.