compiler/src/Language/Bond/Codegen/Haskell/StructDecl.hs
Reduce duplication Open
Open
typeName = mkType $ makeDeclName decl
- Read upRead up
- Exclude checks
Found
typeName = mkType $ makeDeclName decl
typeParams
= map (\ TypeParam{paramName} -> UnkindedVar $ mkVar paramName)
declParams
fieldModules
= unique $
filter (/= moduleName) $
filter (/= internalModuleAlias) $
concatMap (getTypeModules . snd) fields
mkField f
= ([mkVar $ makeFieldName f],
hsType (setType opts) ctx (fieldType f))
ownFields = map mkField structFields
fields
| Just base <- structBase =
([baseStructField], hsType (setType opts) ctx base) : ownFields
| otherwise = ownFields
Perhaps
Combine with compiler/src/Language/Bond/Codegen/Haskell/StructDecl.hs:193:5