File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ instance Compile (ContractDecl Id) where
8181 compile d = pure d
8282
8383instance Compile (Constructor Id ) where
84- compile (Constructor ps bd payable inits ) =
85- (\ bd' -> Constructor ps bd' payable inits ) <$> compile bd
84+ compile (Constructor ps bd payable ins ) =
85+ (\ bd' -> Constructor ps bd' payable ins ) <$> compile bd
8686
8787instance Compile (FunDef Id ) where
8888 compile (FunDef p sig bd) =
Original file line number Diff line number Diff line change @@ -164,17 +164,17 @@ instance (Pretty a) => Pretty (ContractDecl a) where
164164 ppr c
165165
166166instance (Pretty a ) => Pretty (Constructor a ) where
167- ppr (Constructor ps bd payable inits ) =
167+ ppr (Constructor ps bd payable ins ) =
168168 (if payable then text " payable" <+> text " constructor" else text " constructor" )
169169 <+> pprParams ps
170- <+> pprCtorInits inits
170+ <+> pprCtorInits ins
171171 <+> lbrace
172172 $$ nest 3 (vcat (map ppr bd))
173173 $$ rbrace
174174
175175pprCtorInits :: (Pretty a ) => [(Name , [Exp a ])] -> Doc
176176pprCtorInits [] = empty
177- pprCtorInits inits = text " :" <+> commaSep [ppr b <> parens (commaSep (map ppr es)) | (b, es) <- inits ]
177+ pprCtorInits ins = text " :" <+> commaSep [ppr b <> parens (commaSep (map ppr es)) | (b, es) <- ins ]
178178
179179instance Pretty DataTy where
180180 ppr (DataTy n ps cs ds) =
Original file line number Diff line number Diff line change @@ -224,8 +224,8 @@ instance Names (FunDef Name) where
224224 names sig `union` names bdy
225225
226226instance Names (Constructor Name ) where
227- names (Constructor ps bdy _ inits ) =
228- names ps `union` names bdy `union` names (concatMap snd inits )
227+ names (Constructor ps bdy _ ins ) =
228+ names ps `union` names bdy `union` names (concatMap snd ins )
229229
230230instance Names (Class Name ) where
231231 names (Class _ ctx _ _ _ sigs) =
Original file line number Diff line number Diff line change @@ -432,11 +432,11 @@ instance (HasType a) => HasType (Field a) where
432432 bv (Field _ t me) = bv t `union` bv me
433433
434434instance (HasType a ) => HasType (Constructor a ) where
435- apply s (Constructor ps bd payable inits ) =
436- Constructor (apply s ps) (apply s bd) payable [(b, apply s es) | (b, es) <- inits ]
437- fv (Constructor ps bd _ inits ) =
438- fv ps `union` fv bd `union` fv (concatMap snd inits )
439- mv (Constructor ps bd _ inits ) =
440- mv ps `union` mv bd `union` mv (concatMap snd inits )
441- bv (Constructor ps bd _ inits ) =
442- bv ps `union` bv bd `union` bv (concatMap snd inits )
435+ apply s (Constructor ps bd payable ins ) =
436+ Constructor (apply s ps) (apply s bd) payable [(b, apply s es) | (b, es) <- ins ]
437+ fv (Constructor ps bd _ ins ) =
438+ fv ps `union` fv bd `union` fv (concatMap snd ins )
439+ mv (Constructor ps bd _ ins ) =
440+ mv ps `union` mv bd `union` mv (concatMap snd ins )
441+ bv (Constructor ps bd _ ins ) =
442+ bv ps `union` bv bd `union` bv (concatMap snd ins )
You can’t perform that action at this time.
0 commit comments