aboutsummaryrefslogtreecommitdiffstats
path: root/autotypes/src/AutoTypes.hs
diff options
context:
space:
mode:
Diffstat (limited to 'autotypes/src/AutoTypes.hs')
-rw-r--r--autotypes/src/AutoTypes.hs3
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]))