Third question: the most interesting inner methods...
# arrow
b
Third question: the most interesting inner methods look something like the following:
Copy code
fun loadContents(ins: InputStream) = fx {
        val bytes = IOUtils.toByteArray(ins)
        IO { ins.close() }
        bytes
    }

fun parseContents(bs: ByteArray) = IO { OBJECT_MAPPER.readTree(bs) }

fun loadNamedResources(pathspec: String = "$RESOURCE_PATH/*.json") = loadResources(pathspec).map(::getNamedResources)

fun loadSingleResource(pathspec: String): IO<Resource> = fx { PATTERN_RESOLVER.getResource(pathspec) }