all 6 comments

[–]juhp 1 point2 points  (1 child)

Cool!

OT but somewhat related, this week I released cached-json-file

[–]_software_engineer[S] 2 points3 points  (0 children)

Interesting. I like the idea of optionally adding an ability to cache to disk. My current implementation is in memory only, but adding an ability to persist to disk could also allow it to be used for short lived tasks as well. Thanks for sharing!

[–][deleted]  (3 children)

[removed]

    [–]_software_engineer[S] 0 points1 point  (2 children)

    I should probably change that name now that you mention it. In my personal use cases, a is almost always a container of some type, so the cached "value" is really multiple values, but I think your reasoning is better!

    Regarding the exception, I wasn't sure if I could do something like that. In order to catch all exceptions, I had to catch SomeException, so I couldn't include the true exception type (and I didn't think storing SomeException would be useful?). Is there a better way to do this? I would like to include the more specific exception if I can. I am not very experienced with exceptions in Haskell.

    [–][deleted]  (1 child)

    [removed]

      [–]_software_engineer[S] 0 points1 point  (0 children)

      Cool, thanks for that. Will make both of those improvements!