@@ -251,11 +251,18 @@ destructHelp path (A.At region pattern) revDs =
251251 destructTwo path a b revDs
252252
253253 Can.PTuple a b (Just c) ->
254− do name <- Names.generate
255− let newRoot = Opt.Root name
256− destructHelp (Opt.Index Index.first newRoot) a =<<
257− destructHelp (Opt.Index Index.second newRoot) b =<<
258− destructHelp (Opt.Index Index.third newRoot) c (Opt.Destructor name path : revDs)
254+ case path of
255+ Opt.Root _ ->
256+ destructHelp (Opt.Index Index.first path) a =<<
257+ destructHelp (Opt.Index Index.second path) b =<<
258+ destructHelp (Opt.Index Index.third path) c revDs
259+
260+ _ ->
261+ do name <- Names.generate
262+ let newRoot = Opt.Root name
263+ destructHelp (Opt.Index Index.first newRoot) a =<<
264+ destructHelp (Opt.Index Index.second newRoot) b =<<
265+ destructHelp (Opt.Index Index.third newRoot) c (Opt.Destructor name path : revDs)
259266
260267 Can.PList [] ->
261268 pure revDs
@@ -276,19 +283,27 @@ destructHelp path (A.At region pattern) revDs =
276283 pure revDs
277284
278285 Can.PCtor _ _ _ _ _ args ->
279− do name <- Names.generate
280− foldM
281− (destructCtorArg (Opt.Root name))
282− (Opt.Destructor name path : revDs)
283− args
286+ case path of
287+ Opt.Root _ ->
288+ foldM (destructCtorArg path) revDs args
289+
290+ _ ->
291+ do name <- Names.generate
292+ foldM (destructCtorArg (Opt.Root name)) (Opt.Destructor name path : revDs) args
284293
285294
286295destructTwo :: Opt.Path -> Can.Pattern -> Can.Pattern -> [Opt.Destructor] -> Names.Tracker [Opt.Destructor]
287296destructTwo path a b revDs =
288− do name <- Names.generate
289− let newRoot = Opt.Root name
290− destructHelp (Opt.Index Index.first newRoot) a =<<
291− destructHelp (Opt.Index Index.second newRoot) b (Opt.Destructor name path : revDs)
297+ case path of
298+ Opt.Root _ ->
299+ destructHelp (Opt.Index Index.first path) a =<<
300+ destructHelp (Opt.Index Index.second path) b revDs
301+
302+ _ ->
303+ do name <- Names.generate
304+ let newRoot = Opt.Root name
305+ destructHelp (Opt.Index Index.first newRoot) a =<<
306+ destructHelp (Opt.Index Index.second newRoot) b (Opt.Destructor name path : revDs)
292307
293308
294309destructCtorArg :: Opt.Path -> [Opt.Destructor] -> Can.PatternCtorArg -> Names.Tracker [Opt.Destructor]