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
27
28
29
|
module FunctionInversion where
invf1 :: (a -> b) -> (b -> a)
invf1 f y | f x =:<= y = x where x free
invf2 :: (a -> b -> c) -> (c -> (a,b))
invf2 f y | f x1 x2 =:<= y = (x1,x2) where x1,x2 free
invf3 :: (a -> b -> c -> d) -> (d -> (a,b,c))
invf3 f y | f x1 x2 x3 =:<= y = (x1,x2,x3) where x1,x2,x3 free
invf4 :: (a -> b -> c -> d -> e) -> (e -> (a,b,c,d))
invf4 f y | f x1 x2 x3 x4 =:<= y = (x1,x2,x3,x4) where x1,x2,x3,x4 free
invf5 :: (a -> b -> c -> d -> e -> f) -> (f -> (a,b,c,d,e))
invf5 f y | f x1 x2 x3 x4 x5 =:<= y = (x1,x2,x3,x4,x5) where x1,x2,x3,x4,x5 free
|