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
30
31
|
module Data.Function.Inversion where
invf1 :: (Data a, Data b) => (a -> b) -> (b -> a)
invf1 f y | f x =:<= y = x where x free
invf2 :: (Data a, Data b, Data c) => (a -> b -> c) -> (c -> (a,b))
invf2 f y | f x1 x2 =:<= y = (x1,x2) where x1,x2 free
invf3 :: (Data a, Data b, Data c, Data d) =>
(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 :: (Data a, Data b, Data c, Data d, Data e) =>
(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 :: (Data a, Data b, Data c, Data d, Data e, Data f) =>
(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
|