Skip to main content
my ghci is too old
Source Link
Christian Sievers
  • 7.1k
  • 1
  • 19
  • 25

Haskell, 4343 41 bytes

l=['A'..'Z']
m=mapM(putStrLn.(`map`l<$>l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.

Saved 2 bytes thanks to @wchargin. Depending on the interpretation of the task, we can save 2 more by deleting m= and saying that the remaining part is the function that you can put into main=...

Haskell, 43 bytes

l=['A'..'Z']
m=mapM(putStrLn.(`map`l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.

Haskell, 43 41 bytes

l=['A'..'Z']
m=mapM(putStrLn.(<$>l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.

Saved 2 bytes thanks to @wchargin. Depending on the interpretation of the task, we can save 2 more by deleting m= and saying that the remaining part is the function that you can put into main=...

haskell allows more than I thought
Source Link
Christian Sievers
  • 7.1k
  • 1
  • 19
  • 25

Haskell, 4443 bytes

l=['A'..'Z']
m=mapM_m=mapM(putStrLn.(`map`l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.

Haskell, 44 bytes

l=['A'..'Z']
m=mapM_(putStrLn.(`map`l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.

Haskell, 43 bytes

l=['A'..'Z']
m=mapM(putStrLn.(`map`l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.

Source Link
Christian Sievers
  • 7.1k
  • 1
  • 19
  • 25

Haskell, 44 bytes

l=['A'..'Z']
m=mapM_(putStrLn.(`map`l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.