File tree Expand file tree Collapse file tree
src/Language/PureScript/TypeChecker Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ module Main where
2+
3+ import Prelude
4+ import Data.Monoid (class Monoid , mempty )
5+ import Control.Monad.Eff.Console (log , logShow )
6+
7+ data B a = B a a
8+
9+ memptyB :: forall a b . Monoid b => B (a -> b )
10+ memptyB = B l r where
11+ l _ = mempty
12+ r _ = mempty
13+
14+ main = do
15+ logShow $ case (memptyB :: B (Int -> Array Unit )) of B l r -> l 0 == r 0
16+ log " Done"
Original file line number Diff line number Diff line change @@ -357,7 +357,8 @@ infer' (Abs binder ret)
357357 ty <- freshType
358358 withBindingGroupVisible $ bindLocalVariables [(arg, ty, Defined )] $ do
359359 body@ (TypedValue _ _ bodyTy) <- infer' ret
360- return $ TypedValue True (Abs (VarBinder arg) body) $ function ty bodyTy
360+ (body', bodyTy') <- instantiatePolyTypeWithUnknowns body bodyTy
361+ return $ TypedValue True (Abs (VarBinder arg) body') (function ty bodyTy')
361362 | otherwise = internalError " Binder was not desugared"
362363infer' (App f arg) = do
363364 f'@ (TypedValue _ _ ft) <- infer f
You can’t perform that action at this time.
0 commit comments