File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
src/Language/PureScript/TypeChecker Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ module Main where
2+
3+ import Control.Monad.Eff
4+ import Control.Monad.ST
5+
6+ type State bindings =
7+ {
8+ bindings :: { addition :: Number | bindings } ,
9+ other :: String
10+ }
11+
12+ type MyBindings = (test :: Number )
13+
14+ data Shadow bindings = Shadow String
15+
16+ shadows :: Shadow (Object MyBindings )
17+ shadows = Shadow " uhh"
18+
19+ main :: Eff () Unit
20+ main = withIt
21+ shadows
22+ \ bindings -> do
23+ let state =
24+ {
25+ bindings : bindings,
26+ other : " Test"
27+ }
28+ runST do
29+ stRef <- newSTRef state
30+ handleKeyD stRef
31+ return unit
32+
33+
34+ withIt :: forall bindings eff a . Shadow (Object bindings ) ->
35+ ({ addition :: Number | bindings } -> Eff eff a ) -> Eff eff a
36+ withIt (Shadow str) success = do
37+ b <- withBindings
38+ success (b{addition = 1 })
39+
40+ foreign import withBindings
41+ """
42+ function withBindings() {}
43+ """ :: forall eff bindings . Eff eff bindings
44+
45+ handleKeyD :: forall h eff . STRef h (State MyBindings ) -> Eff (st :: ST h | eff ) Unit
46+ handleKeyD state = return unit
Original file line number Diff line number Diff line change @@ -130,6 +130,10 @@ unifyRows r1 r2 =
130130 rest <- fresh
131131 u1 =:= rowFromList (sd2, rest)
132132 u2 =:= rowFromList (sd1, rest)
133+ unifyRows' sd1 (SaturatedTypeSynonym name args) sd2 r2' = do
134+ r1' <- expandTypeSynonym name $ args
135+ unifyRows (rowFromList (sd1, r1')) (rowFromList (sd2, r2'))
136+ unifyRows' sd1 r1' sd2 r2'@ (SaturatedTypeSynonym _ _) = unifyRows' sd2 r2' sd1 r1'
133137 unifyRows' [] REmpty [] REmpty = return ()
134138 unifyRows' [] (TypeVar v1) [] (TypeVar v2) | v1 == v2 = return ()
135139 unifyRows' [] (Skolem _ s1 _) [] (Skolem _ s2 _) | s1 == s2 = return ()
You can’t perform that action at this time.
0 commit comments