coding style - Haskell similar types copy-paste elimination in case -
case x of cond expr stmt -> checkexprtype expr bool processstmt env stmt return env anothercond expr stmt -> checkexprtype expr bool processstmt env stmt return env how can copy-paste eliminated?
you make local definition function of expr , stmt:
-- assume inside 'do' block let conditionallike expr stmt = checkexprtype expr bool processstmt env stmt return env case x of cond expr stmt -> conditionallike expr stmt anothercond expr stmt -> conditionallike expr stmt
Comments
Post a Comment