Skip to main content

Haskell, 24 characters

sequence_ (repeat (print "abc"))
sequence_ (repeat (print "abc"))

or in a condensed form, with 24 characters

sequence_$repeat$print"" 
sequence_$repeat$print"" 

(although the text is changed, this will still loop - this will print two quotes and a newline infinitely)

explanation: print "abc" is basically an i/o action that just prints "abc".
repeat is a function which takes a value x and returns an infinite list made of only x.
sequence_ is a function that takes a list of i/o actions and returns an i/o action that does all of the actions sequentially.

so, basically, this program makes an infinite list of print "abc" commands, and repeatedly executes them. with no loops or recursion.

Haskell, 24 characters

sequence_ (repeat (print "abc"))

or in a condensed form, with 24 characters

sequence_$repeat$print"" 

(although the text is changed, this will still loop - this will print two quotes and a newline infinitely)

explanation: print "abc" is basically an i/o action that just prints "abc".
repeat is a function which takes a value x and returns an infinite list made of only x.
sequence_ is a function that takes a list of i/o actions and returns an i/o action that does all of the actions sequentially.

so, basically, this program makes an infinite list of print "abc" commands, and repeatedly executes them. with no loops or recursion.

Haskell, 24 characters

sequence_ (repeat (print "abc"))

or in a condensed form, with 24 characters

sequence_$repeat$print"" 

(although the text is changed, this will still loop - this will print two quotes and a newline infinitely)

explanation: print "abc" is basically an i/o action that just prints "abc".
repeat is a function which takes a value x and returns an infinite list made of only x.
sequence_ is a function that takes a list of i/o actions and returns an i/o action that does all of the actions sequentially.

so, basically, this program makes an infinite list of print "abc" commands, and repeatedly executes them. with no loops or recursion.

added 10 characters in body
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37

Haskell, 24 characters

sequence_ (repeat (print "abc"))

or in a condensed form, with 24 characters

sequence_$repeat$print"" 

(although the text is changed, this will still loop - this will print two quotes and a newline infinitely)

explanation: print "abc" is basically an i/o action that just prints "abc". 
repeat is a function which takes a value x and returns an infinite list made of only x. 
sequence_ is a function that takes a list of i/o actions and returns an i/o action that does all of the actions sequentially.

so, basically, this program makes an infinite list of print "abc" commands, and repeatedly executes them. with no loops or recursion.

Haskell, 24 characters

sequence_ (repeat (print "abc"))

or in a condensed form, with 24 characters

sequence_$repeat$print"" 

(although the text is changed, this will still loop - this will print two quotes and a newline infinitely)

explanation: print "abc" is basically an i/o action that just prints "abc". repeat is a function which takes a value x and returns an infinite list made of only x. sequence_ is a function that takes a list of i/o actions and returns an i/o action that does all of the actions sequentially.

so, basically, this program makes an infinite list of print "abc" commands, and repeatedly executes them. with no loops or recursion.

Haskell, 24 characters

sequence_ (repeat (print "abc"))

or in a condensed form, with 24 characters

sequence_$repeat$print"" 

(although the text is changed, this will still loop - this will print two quotes and a newline infinitely)

explanation: print "abc" is basically an i/o action that just prints "abc". 
repeat is a function which takes a value x and returns an infinite list made of only x. 
sequence_ is a function that takes a list of i/o actions and returns an i/o action that does all of the actions sequentially.

so, basically, this program makes an infinite list of print "abc" commands, and repeatedly executes them. with no loops or recursion.

Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37

Haskell, 24 characters

sequence_ (repeat (print "abc"))

or in a condensed form, with 24 characters

sequence_$repeat$print"" 

(although the text is changed, this will still loop - this will print two quotes and a newline infinitely)

explanation: print "abc" is basically an i/o action that just prints "abc". repeat is a function which takes a value x and returns an infinite list made of only x. sequence_ is a function that takes a list of i/o actions and returns an i/o action that does all of the actions sequentially.

so, basically, this program makes an infinite list of print "abc" commands, and repeatedly executes them. with no loops or recursion.