This language bar is your friend. Select your favorite languages!
Edit summary for version 24 :

Version 23

Version 24

Idiom #76 Binary digits from an integer

Create the string s of integer x written in base 2.

E.g. 13 -> "1101"

Idiom #76 Binary digits from an integer

Create the string s of integer x written in base 2.

E.g. 13 -> "1101"

Code
s x = Numeric.showIntAtBase 2 Data.Char.intToDigit x ""