builtins :: BackendPossible PyDopeBS
builtins (f,is,o) = case () of
- _ | all isGround is
+ _ | all isGround is
-> maybe (Left False) gencall $ M.lookup (f,length is) constants
where
gencall pc = case () of
pslice vs = brackets $
sepBy "," (map (\x -> if nGround (x^.mv_mi) then pretty (x^.mv_var) else ":") vs)
- <> "," -- add a list comma to ensure getitem is always passed a tuple.
+ <> "," -- add a comma to ensure getitem is always passed a tuple.
+
+piterate vs = parens $
+ sepBy "," (map (\x -> if nGround (x^.mv_mi) then "_" else pretty (x^.mv_var)) vs)
+ <> "," -- add a comma to ensure tuple.
+
filterGround = map (^.mv_var) . filter (not.nGround.(^.mv_mi))
pdope_ (OPIter o m f _ Nothing) =
let mo = m ++ [o] in
- "for" <+> (tupledOrUnderscore $ filterGround mo)
+ "for" <+> piterate mo --(tupledOrUnderscore $ filterGround mo)
<+> "in" <+> functorIndirect "chart" f m <> pslice mo <> colon
-- XXX Ought to make i and vs conditional on... doing debugging or the