Skip to content

Commit d513933

Browse files
committed
Type.Infer: inferExpr: (case -> fmap)
1 parent ae51fe0 commit d513933

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Nix/Type/Infer.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,8 @@ inferType env ex = do
257257

258258
-- | Solve for the toplevel type of an expression in a given environment
259259
inferExpr :: Env -> NExpr -> Either InferError [Scheme]
260-
inferExpr env ex = case runInfer (inferType env ex) of
261-
Left err -> Left err
262-
Right xs -> Right $ fmap (\(subst, ty) -> closeOver (subst `apply` ty)) xs
260+
inferExpr env ex =
261+
(fmap . fmap) (\(subst, ty) -> closeOver (subst `apply` ty)) $ runInfer $ inferType env ex
263262

264263
-- | Canonicalize and return the polymorphic toplevel type.
265264
closeOver :: Type -> Scheme

0 commit comments

Comments
 (0)