module Main where import AutoTypes.Unify as U import Data.Aeson (Value, decodeFileStrict', encode) import qualified Data.ByteString.Lazy as B import System.Environment (getArgs) import System.FilePath (takeFileName) main :: IO () main = do filePaths <- getArgs types <- mapM ( \filePath -> do Just value <- decodeFileStrict' filePath pure (U.fromJson value) ) filePaths B.putStr ( encode ( head ( foldr1 (\ls rs -> (concat [unify1 l r | l <- ls, r <- rs])) (map (: []) types) ) ) )