<div dir="ltr">Hi Marc, and welcome to the haskell beginners list.<div class="gmail_extra"><br clear="all"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">```<br>
migrate :: IO ()<br>
migrate = do<br>
    dir <- dBDir<br>
    createDirectoryIfMissing True dir<br>
    forM_ (categories, expenses)<br>
       $ withDB . createTable<br>
```<br>
<br>
tables are not actually created.<br>
<br></blockquote><div><br></div><div>Well, </div><div><br></div><div>forM_ (categories, expenses) $ withDB . createTable<br></div><div><br></div><div>is equivalent to </div><div><br></div><div>withDB . createTable $ expenses.</div><div><br></div><div>So exactly one table is created.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
```<br>
["a", "b"] `forM_` print<br>
```<br>
<br>
Actually prints both `"a"` and `"b"`.<br>
<br></blockquote><div><br></div><div>Here the code uses square brackets--and so we have honest-to-goodness lists--whereas the previous used parentheses.</div><div><br></div><div>See what happens with: ("a","b") `forM_` print.</div><div><br></div><div>Marc: Feel free to write to the haskell-cafe mailing list for questions such as this. Fortuitously in this case, it turns out that your query needed knowledge only about the forM* combinators and--ever since their ilk was generalized--the known instances declared for the Traversable constraint. As you explore the domain-specific package "selda" further, you will find more people acquainted with the package over at the cafe than here in beginners. Suffice to say, everyone here in this list is also in cafe, which is also open to beginners questions.</div><div><br></div><div>p.s. Veterans would recognize this as ye olde controversy on the Foldable instance for pairs introduced in GHC 7.10.x. The controversy still simmers apparently because there isn't an instance for triples and higher tuples in the latest and greatest GHC 8.4.1. We are at the mercy of this potentially toe-stubbing absence of uniformity.</div><div><br></div><div>-- Kim-Ee</div><div><br></div></div></div></div>