@@ -102,6 +102,7 @@ arity :: Type v a -> Int
102
102
arity (ForallNamed' _ body) = arity body
103
103
arity (Arrow' _ o) = 1 + arity o
104
104
arity (Ann' a _) = arity a
105
+ arity (Effect' _ o) = arity o
105
106
arity _ = 0
106
107
107
108
-- some smart patterns
@@ -142,7 +143,7 @@ pattern Effects' es <- ABT.Tm' (Effects es)
142
143
pattern Effect1' :: ABT. Term F v a -> ABT. Term F v a -> ABT. Term F v a
143
144
pattern Effect1' e t <- ABT. Tm' (Effect e t)
144
145
145
- pattern Effect' :: ( Ord v ) => [Type v a ] -> Type v a -> Type v a
146
+ pattern Effect' :: [Type v a ] -> Type v a -> Type v a
146
147
pattern Effect' es t <- (unEffects1 -> Just (es, t))
147
148
148
149
pattern Effect'' :: (Ord v ) => [Type v a ] -> Type v a -> Type v a
@@ -242,7 +243,7 @@ unEffect0 :: (Ord v) => Type v a -> ([Type v a], Type v a)
242
243
unEffect0 (Effect1' e a) = (flattenEffects e, a)
243
244
unEffect0 t = ([] , t)
244
245
245
- unEffects1 :: ( Ord v ) => Type v a -> Maybe ([Type v a ], Type v a )
246
+ unEffects1 :: Type v a -> Maybe ([Type v a ], Type v a )
246
247
unEffects1 (Effect1' (Effects' es) a) = Just (es, a)
247
248
unEffects1 _ = Nothing
248
249
@@ -756,6 +757,7 @@ functionResult = go False
756
757
where
757
758
go inArr (ForallNamed' _ body) = go inArr body
758
759
go _inArr (Arrow' _i o) = go True o
760
+ go _inArr (Effect1' _e body) = go True body
759
761
go inArr t = if inArr then Just t else Nothing
760
762
761
763
-- | Bind all free variables (not in `except`) that start with a lowercase
0 commit comments