-- Build all injections from source list to target list
injections :: [a] -> [b] -> [Injection a b]
injections l l'
    | length l > length l' = []
    | otherwise =
        case l of
          [] -> [Injection []]
          [x] -> [ singleton (x, y) | y <- l' ]
          x : xl -> f [] l'
              where
                f a (y : b) = f (y : a) b ++
                            map (insertMapping (x, y)) (injections xl $ a ++ b)
                f _ [] = []
injections :: [a] -> [b] -> [Injection a b]
injections l l'
    | length l > length l' = []
    | otherwise =
        case l of
          [] -> [Injection []]
          [x] -> [ singleton (x, y) | y <- l' ]
          x : xl -> f [] l'
              where
                f a (y : b) = f (y : a) b ++
                            map (insertMapping (x, y)) (injections xl $ a ++ b)
                f _ [] = []
injections l l'
    | length l > length l' = []
    | otherwise =
        case l of
          [] -> [Injection []]
          [x] -> [ singleton (x, y) | y <- l' ]
          x : xl -> f [] l'
              where
                f a (y : b) = f (y : a) b ++
                            map (insertMapping (x, y)) (injections xl $ a ++ b)
                f _ [] = []