add naive schema comparison

This commit is contained in:
Alexander Foremny
2024-06-06 09:25:05 +02:00
parent bfb98d7675
commit 4003a86325
3 changed files with 20 additions and 14 deletions

View File

@@ -4,7 +4,6 @@ module AutoTypes
)
where
import Debug.Trace
import qualified AutoTypes.Unify as U
import Data.Aeson (Value, decodeFileStrict', encode)
import Data.Maybe (fromJust)
@@ -17,7 +16,7 @@ autoTypes fp fps = autoTypes' <$> go fp <*> mapM go (fp : fps)
autoTypes' :: Value -> [Value] -> U.T
autoTypes' t' ts' =
let types = map U.fromJson (Debug.Trace.traceShowId (t' : ts'))
let types = map U.fromJson (t' : ts')
in head
( foldr1
(\ls rs -> (concat [U.unify1 l r | l <- ls, r <- rs]))