import Data.Char
fak::Int->Int
fak a = foldr (*) 1 [1..a]
length2::[a]->Int
length2 a = foldr (lengthH) 0 a
where lengthH _ n = n+1
or::[Bool]->Bool
or a = foldr (||) False a
drehUm as = foldl (drehUmH ) [] as
where drehUmH bs a = [a]++bs
conci as = foldl (++) [] as
mapi as f = foldl (mapiH f) [] as
where mapiH f bs a = [f a]++bs
filteri bed as = foldl (filteriH bed) [] as
where filteriH bed bs a
|bed a=bs++[a]
|otherwise = bs
wert as = foldl (+) 0 (foldl (wertH (length as)) [] as)
where wertH lengthl bs a = bs ++ [10^(lengthl-length bs-1)*(ord(a)-48)]
deTupel as = foldl (deTupelH) ([],[]) as
where deTupelH (a,b) c = (a++[fst c],b++[snd c])
loesche as l = foldl (loescheH l) [] as
where loescheH l bs a
|l==a=bs
|otherwise = bs++[a]
elem as e= foldl (elemH e) False as
where elemH e bs a = bs||(e==a)