module Exercise_7 where import Data.List import Data.Char import Data.Function import GHC.Num {-WETT-} trancl :: Eq a => [(Integer,(a,a))] -> [(Integer,(a,a))] trancl xs= if findTrancl == xs then xs else trancl findTrancl where findTrancl = nubBy (on (==) snd) $sortOn fst $xs++[(i+j,(fst ab, snd cd))|(i,ab)<-xs, (j,cd)<-xs,snd ab==fst cd] {-TTEW-}