Say we have this module:And we load it like thisThat will print "Loaded" when it's required. Say we want to capture the standard output of that loaded module. We can do that if it's an external process, but there does not seem to be a way for redirecting *OUT to...
In general I have problems figuring out how to write tailrecursive functions when working 'inside' monads. Here is a quick example:
I have a very large text file (around 20 GB and 300 million lines), which contains three columns separated by tabs:
I was trying this and a few other things but it truncates the file each time:Changing this to open $file, :a also seems to truncate the file. This is 2018.04 on macOS.