diff options
author | 2024-12-17 20:34:31 +0100 | |
---|---|---|
committer | 2025-02-19 18:09:41 +0100 | |
commit | d29d951cf8c5558511830a85bb91ab030711b7e7 (patch) | |
tree | 88fa48bad69815b7e2a30cb9de3393343c555c6c /autotypes/src/AutoTypes.hs | |
parent | fe07f05b8e4f0c7e6eec2714ee1ed5a67b227eda (diff) |
ignore nulls in types
Diffstat (limited to 'autotypes/src/AutoTypes.hs')
-rw-r--r-- | autotypes/src/AutoTypes.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/autotypes/src/AutoTypes.hs b/autotypes/src/AutoTypes.hs index ddc948c..493fe11 100644 --- a/autotypes/src/AutoTypes.hs +++ b/autotypes/src/AutoTypes.hs @@ -6,6 +6,7 @@ where import qualified AutoTypes.Unify as U import Data.Aeson (Value, decodeFileStrict', encode) +import Data.Maybe import Data.Maybe (fromJust) import System.Environment (getArgs) import System.FilePath (takeFileName) @@ -17,7 +18,7 @@ autoTypes fp fps = autoTypes' <$> go fp <*> mapM go (fp : fps) autoTypes' :: Value -> [Value] -> U.T autoTypes' t' ts' = - let types = map U.fromJson (t' : ts') + let types = mapMaybe U.fromJson (t' : ts') in head ( foldr1 (\ls rs -> (concat [U.unify1 l r | l <- ls, r <- rs])) |