aboutsummaryrefslogtreecommitdiff
path: root/Semestr 3/anm/l10.hs
blob: dfccaf4b3da38ed259d7a6a22029641e6f10946b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- Zadanie 1

int :: (String -> a) -> String -> Integer -> a
int f s n = f (s ++ show n)

str :: (String -> a) -> String -> String -> a
str f s1 s2 = f (s1 ++ s2)

lit :: String -> (String -> a) -> String -> a
lit s f s2 = f (s2 ++ s)

(^^) :: (b -> c) -> (a -> b) -> a -> c
(^^) = (.)

sprintf :: ((String -> a) -> String -> String) -> String
sprintf f = f id ""