What I would like:here :: (Loc -> a) -> a
So that I can use it for generic logging (using IO, or Writer, or whatever), like here $ log "Connecting..".
But I can't use a function to capture the actual call-site location, since the underlying (CPP / TH) would always capture the Loc of the here body, which is obviously not ok.
Currently the only option I see is to explicitly do a TH call, which is ugly (and pulls in TH dependency).
Any option about this? I would love to have a special here function in Haskell which would just expand location in compile time, without TH.submitted by literon
[link] [19 comments]
After receiving some great advice on how to implement a map-like container which can retire items in least recently used (LRU) order on overflow, I went ahead and did some implementing & measuring. I have solved the problem for my use case to my satisfaction, thought I share my solution(s), benchmarks and code here:
Hope it's useful to somebody!submitted by SirRockALot1
[link] [4 comments]