Verified Commit c513a021 authored by Camil Staps's avatar Camil Staps 🚀

Fix parentheses in functions generated for infix constructors

parent 616ad975
......@@ -758,16 +758,16 @@ constructor_functions etd = [
& fe_loc='CDB'.setName c etd.tde_loc
, fe_kind=Constructor
, fe_type=Just f
, fe_representation=Just $ concat $ [c] ++ print_prio p ++ [" :: "] ++ print False f
, fe_representation=Just $ concat $ print_prio c p ++ [" :: "] ++ print False f
, fe_priority=p
, fe_documentation=constructorToFunctionDoc <$> doc
}
\\ (c,f,p) <- 'T'.constructorsToFunctions ('CDB'.getTypeDef etd)
& doc <- cons_doc]
where
print_prio :: (Maybe 'T'.Priority) -> [String]
print_prio Nothing = []
print_prio (Just p) = [" "] ++ print False p
print_prio :: !String (Maybe 'T'.Priority) -> [String]
print_prio name Nothing = [name]
print_prio name (Just p) = ["(",name,") ":print False p]
cons_doc = fromMaybe [] (docConstructors =<< 'CDB'.getTypeDefDoc etd) ++ repeat Nothing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment