<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta name="viewport" content="width=device-width,initial-scale=1"> <!--[if gte mso 9]>
    <xml>
      <o:OfficeDocumentSettings>
        <o:AllowPNG/>
        <o:PixelsPerInch>96</o:PixelsPerInch>
     </o:OfficeDocumentSettings>
    </xml>
    <![endif]--> <style type="text/css">* a:hover{cursor:pointer;}</style> <style>body {-webkit-animation:bugfix infinite 1s;}@-webkit-keyframes bugfix {from {position:relative;}to {position:relative;}}</style> </head> <body style="word-wrap:normal;word-break:break-word"> <style>a {word-wrap:normal;word-break:break-word;}.background-contain {background-size:contain;}@media only screen and (max-width:600px) {.container {-webkit-text-size-adjust:none !important;}.container,.palm-one-whole {width:100% !important;min-width:100% !important;}.palm-one-half {width:50% !important;min-width:50% !important;box-sizing:border-box;}blockquote .container,blockquote .container div,blockquote .container table {width:auto !important;min-width:0 !important;position:relative !important;}img {max-width:100%;}.border-outer,.border-middle,.border-inner,.inner,[title="separator"] {width:100% !important;}.innercell {padding:8px !important;}.palm-block {display:block !important;}td.palm-one-whole {display:inline-block !important;padding:0;}td.palm-one-whole:first-child:not(:only-child) {margin-bottom:16px;}td.hostname {padding-top:3px !important;}}@media only screen and (min-width:601px) {.preview-card {max-width:600px !important;}}@media only screen and (min-device-width :320px) and (max-device-width :568px),only screen and (min-device-width :768px) and (max-device-width :1024px),only screen and (max-device-width:640px),only screen and (max-device-width:667px),only screen and (max-width:480px){.container {width:100% !important;min-width:100% !important;}.p,.small,li,font[size="2"],font[size="3"] {font-size:1em !important;}}@media only screen and (min-device-width :320px) and (max-device-width :568px),only screen and (min-device-width :768px) and (max-device-width :1024px),only screen and (min-device-width :1224px)  {.message-wrapper {padding-top:6px;}.apple-only[style] {display:block !important;max-height:none !important;line-height:normal !important;overflow:visible !important;height:auto !important;width:100% !important;position:relative !important;}.no-apple {display:none !important;}form {font-size:inherit;}input[type="text"] {height:43px;padding-left:4px !important;}button:hover {cursor:pointer;}}@media only screen and (min-device-width :1224px)  {.apple-mail-form {display:block !important;background-color:white !important;}}* [office365] .outlook-com-hidden {display:none !important;}* [office365] .outlook-com-button {display:block;}* [office365] .outlook-com-only {display:block !important;max-height:none !important;line-height:normal !important;overflow:visible !important;height:auto !important;width:100% !important;position:relative !important;}.ExternalClass {width:100%;}.ExternalClass .outlook-com-button {display:block;}.ExternalClass button {height:auto;}.ExternalClass .outlook-com-hidden {display:none !important;}.ExternalClass .outlook-com-only {display:block !important;max-height:none !important;line-height:normal !important;overflow:visible !important;height:auto !important;width:100% !important;position:relative !important;}.ExternalClass .ecxlabels {display:none !important;}.ExternalClass .ecxlabels {display:none !important;}.ExternalClass .ecxarrow {display:none !important;}.ExternalClass cite >div + div {padding:0 0 4px 0;}.ExternalClass .h1 {padding-bottom:5px;}.ExternalClass .h2 {padding-bottom:5px;}.ExternalClass .h3 {padding-bottom:5px;}.ExternalClass [lang="brand-pinterest"] {width:280px !important;}</style> <!--[if (gte mso 9)|(IE)]>
    
    <style>
      a, body {
        font-family: 'Calibri', Arial, sans-serif;
      }
    
      img {
        border: none !important;
        -ms-interpolation-mode:bicubic;
      }
    
      td {
        mso-line-height-rule:exactly !important;
      }
    
      .mso-card-inner table {
        border-collapse: collapse !important;
        mso-table-lspace:0pt;
        mso-table-rspace:0pt;
        vertical-align: top;
      }
    
      .outlook-com-only {
        display: none !important;
        font-size: 0 !important;
      }
    
      #mso-one-whole {
        width: 100% !important;
      }
    
    
    
        .border-outer,
        .border-middle,
        .border-inner {
          border: none !important;
        }
    
        .border-middle,
        .border-inner {
          width: 100% !important;
        }
    
        .mso-border-outer,
        .mso-border-middle,
        .mso-border-inner {
          padding: 1px;
        }
    
        .mso-border-outer { background-color: rgb(245, 255, 255); }
        .mso-border-middle { background-color: rgb(223, 246, 255); }
        .mso-border-inner { background-color: rgb(153, 176, 225); }
    
    </style>
    
    <![endif]--> <table class="container" lang="container" dir="ltr" border="0" cellpadding="0" cellspacing="0" valign="top" style="width:100%;margin-top:6px"> <tr> <td valign="top" class="message-wrapper" style="line-height:1.31;color:#222;font-family:arial,sans-serif"> <!--[if mso]><table  border="0" cellpadding="0" cellspacing="0" valign="top" style="border-collapse:separate;"><tr><td valign="top"><![endif]--> <div>Hi will - I wanted to thank you for your reply. </div><div><br></div><div>It seems like with <code style="font-family:monospace;background-color:rgb(225,225,225)">runStderrLoggingT</code>, I'd have to start learning about monad transformers. I know that this is something that I have to learn eventually; I'm 100% convinced of that, but for now I am going with an orphaned instance of <b>MonadLogger IO. </b>As soon as I wire up the database, I'll start on monad transformers. I've been told that <a href="http://dev.stephendiehl.com/hask/#monad-transformers">Stephen Diehl</a> is a good resource for it. </div><div><br></div><div>Thank you very much.</div><img align="left" width="0" height="0" style="border:0;width:0px;height:0px" src="https://track.mixmax.com/api/track/v2/2t0NH0oEJzSJAlX6F/i02bj5CbpFWbnBkblZXZ0NnLhZXalxmI/IyZy9mLsxWZrNXYoBUZmF2YtwGblt2chhmI/ISZmF2YtwGblt2chhmI?sc=false" alt=""> <!--[if mso]></td></tr></table><![endif]--> </td> </tr> </table> <div> <div> <p data-m-apply-default-font="true"><br></p> <div class="gmail_extra"> <p data-m-apply-default-font="true"><br></p> <div class="gmail_quote"> On Thu, Oct 26, 2017 9:33 AM, Will Yager <span dir="ltr"> <a href="mailto:will.yager@gmail.com" target="_blank">will.yager@gmail.com</a></span> wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <u></u> <div></div><div>You want e.g. <a href="https://hackage.haskell.org/package/monad-logger-0.3.25.1/docs/Control-Monad-Logger.html#v:runStderrLoggingT">https://hackage.haskell.org/package/monad-logger-0.3.25.1/docs/Control-Monad-Logger.html#v:runStderrLoggingT</a></div><div><br></div><div>You can mentally replace “m” with “IO”. </div><div><br></div><div>It takes some monadic action that requires logging (like setting up a database pool) and provides a concrete implementation of how logging should be done (like printing messages to stdout), thus discharging the MonadLogger constraint. See “MTL style”. </div><div><br></div><div>I think MonadLogger is as good an introduction to monad transformers as any, since it’s fairly straightforward. Most of the instances are like the reader monad, where they just pass around some function that takes the log details and does something with them. </div><div><br></div><div><br></div><div>On Oct 26, 2017, at 8:43 AM, Steven Leiva <<a href="mailto:leiva.steven@gmail.com">leiva.steven@gmail.com</a>> wrote:<br><br></div><blockquote type="cite" style="margin:0 0 0 40px"> <meta name="viewport" content="width=device-width,initial-scale=1"> <!--[if gte mso 9]>
    <xml>
      <o:OfficeDocumentSettings>
        <o:AllowPNG/>
        <o:PixelsPerInch>96</o:PixelsPerInch>
     </o:OfficeDocumentSettings>
    </xml>
    <![endif]--> <!--[if (gte mso 9)|(IE)]>
    
    <style>
      a, body {
        font-family: 'Calibri', Arial, sans-serif;
      }
    
      img {
        border: none !important;
        -ms-interpolation-mode:bicubic;
      }
    
      td {
        mso-line-height-rule:exactly !important;
      }
    
      .mso-card-inner table {
        border-collapse: collapse !important;
        mso-table-lspace:0pt;
        mso-table-rspace:0pt;
        vertical-align: top;
      }
    
      .outlook-com-only {
        display: none !important;
        font-size: 0 !important;
      }
    
      #mso-one-whole {
        width: 100% !important;
      }
    
    
    
        .border-outer,
        .border-middle,
        .border-inner {
          border: none !important;
        }
    
        .border-middle,
        .border-inner {
          width: 100% !important;
        }
    
        .mso-border-outer,
        .mso-border-middle,
        .mso-border-inner {
          padding: 1px;
        }
    
        .mso-border-outer { background-color: rgb(245, 255, 255); }
        .mso-border-middle { background-color: rgb(223, 246, 255); }
        .mso-border-inner { background-color: rgb(153, 176, 225); }
    
    </style>
    
    <![endif]--> <table lang="container" dir="ltr" border="0" cellpadding="0" cellspacing="0" valign="top" style="width:100%;margin-top:6px"> <tbody><tr> <td valign="top" style="line-height:1.31;color:#222;font-family:arial,sans-serif"> <!--[if mso]><table  border="0" cellpadding="0" cellspacing="0" valign="top" style="border-collapse:separate;"><tr><td valign="top"><![endif]--> <table lang="container" border="0" cellpadding="0" cellspacing="0" valign="top" style="width:100%;margin-top:6px"><tbody><tr><td valign="top" style="line-height:1.31;font-family:arial,sans-serif"><div><span style="font-family:Arial,sans-serif"> I thought implementing an instance of MonadLogger for IO that would simply typecheck (and not log), but that would lead to an </span><b style="font-family:Arial,sans-serif">orphaned instance</b><span style="font-family:Arial,sans-serif">, correct? What's the easiest next step to make forward progress here? </span></div><div><font face="Arial, sans-serif" color="#222222"><br></font></div><div><font face="Arial, sans-serif" color="#222222">P.S. I am aware that there are a lot of advanced (for me anyway) Haskell that can be done via monad transformers, natural transformations, etc., in order to wire up a DB with Servant, but I am happy with the "next simplest step" until I learn some of those concepts better. (Then Haskell makes refactoring a breeze!).</font></div><div><br></div><div><br></div></td></tr></tbody></table></td></tr></tbody></table></blockquote> </blockquote> </div> </div> </div> </div> <br><br>Steven Leiva<br>305.528.6038<br><a href="mailto:leiva.steven@gmail.com" target="_blank">leiva.steven@gmail.com</a><br><a href="http://www.linkedin.com/in/stevenleiva" target="_blank">http://www.linkedin.com/in/stevenleiva</a><br> </body> </html>