function that generates a String in Haskell

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import Data.List

toBinary :: Integral a => a -> [Bool]
toBinary 0 = []
toBinary x
	| mod x 2 == 0 =  False : toBinary (div x 2) 
	| mod x 2 == 1 =  True : toBinary (div x 2)  

dec2bin :: Integral a => a -> [Bool]
dec2bin x = toBinary x

between :: Integral a => a -> [[Bool]]
between x = map dec2bin [1..x]

convert :: [Bool] -> [Char]
convert [] = []
convert (x:xs)
	| x == True = '1' : convert xs
	| x == False = '0' : convert xs

breit :: [[Bool]] -> [[Char]]
breit [] = []
breit (x:xs) = convert x : breit xs

final :: Integral a => a -> [Char]
final x = (reverse('S':intercalate "s" (breit $ between x)))
10:1: Error: Eta reduce
Found:
dec2bin x = toBinary x
Why not:
dec2bin = toBinary
15:12: Warning: Use String
Found:
[Bool] -> [Char]
Why not:
[Bool] -> String
18:11: Error: Redundant ==
Found:
x == True
Why not:
x
19:11: Warning: Redundant ==
Found:
x == False
Why not:
not x
21:10: Warning: Use String
Found:
[[Bool]] -> [[Char]]
Why not:
[[Bool]] -> [String]
22:1: Error: Use map
Found:
breit [] = []
breit (x : xs) = convert x : breit xs
Why not:
breit xs = map convert xs
25:10: Warning: Use String
Found:
(Integral a) => a -> [Char]
Why not:
(Integral a) => a -> String
26:11: Warning: Redundant bracket
Found:
(reverse ('S' : intercalate "s" (breit $ between x)))
Why not:
reverse ('S' : intercalate "s" (breit $ between x))