<div dir="ltr"><div><div><div>I have the following code and error(also seen at <a href="https://github.com/codygman/frames-credit-card-trans-demo/blob/master/src/Main.hs#L28">https://github.com/codygman/frames-credit-card-trans-demo/blob/master/src/Main.hs#L28</a>):<br><br><br>-- between meaning on or after start but before end<br>dateBetween :: _<br>            -> Day<br>            -> Day<br>            -> Pipe (Record rs) (Record rs) IO r<br>dateBetween target start end = P.filter go<br>  where go :: Record rs -> _<br>        go r = let targetDate = rget target r :: Chicago<br>                   targetDate' = chicagoToZoned targetDate :: ZonedTime<br>                   targetDay = localDay (zonedTimeToLocalTime targetDate') :: Day<br>               in<br>                 targetDay >= start && targetDay < end<br>-- type error<br>-- src/Main.hs:48:38: error: …<br>--     • Couldn't match expected type ‘(Chicago -> f Chicago)<br>--                                     -> Record rs1 -> f (Record rs1)’<br>--                   with actual type ‘t’<br>--         because type variable ‘f’ would escape its scope<br>--       This (rigid, skolem) type variable is bound by<br>--         a type expected by the context:<br>--           Functor f => (Chicago -> f Chicago) -> Record rs1 -> f (Record rs1)<br>--         at /home/cody/source/frames-credit-card-trans-demo/src/Main.hs:48:33-45<br>--     • In the first argument of ‘rget’, namely ‘target’<br>--       In the expression: rget target r :: Chicago<br>--       In an equation for ‘targetDate’:<br>--           targetDate = rget target r :: Chicago<br>--     • Relevant bindings include<br>--         r :: Record rs1<br>--           (bound at /home/cody/source/frames-credit-card-trans-demo/src/Main.hs:48:12)<br>--         go :: Record rs1 -> Bool<br>--           (bound at /home/cody/source/frames-credit-card-trans-demo/src/Main.hs:48:9)<br>--         target :: t<br>--           (bound at /home/cody/source/frames-credit-card-trans-demo/src/Main.hs:46:13)<br>--         dateBetween :: t -> Day -> Day -> Pipe (Record rs) (Record rs) IO r<br>--           (bound at /home/cody/source/frames-credit-card-trans-demo/src/Main.hs:46:1)<br>-- Compilation failed.<br><br></div>Perhaps it's late, but I'm fairly sure I've done something like this before.<br><br></div>Thanks,<br><br></div>Cody<br></div>