local a=script.Parent local C={itertools=require(a:WaitForChild("\105\116\101\114\116\111\111\108\115")),linq=require(a:WaitForChild("\108\105\110\113"));queue=require(a:WaitForChild("\081\117\101\117\101"));randumb=require(a:WaitForChild("\114\097\110\100\117\109\098")),rquery=require(a:WaitForChild("\114\113\117\101\114\121"));stringobj=require(a:WaitForChild("\115\116\114\105\110\103\111\098\106"));t=require(a:WaitForChild("\116")),uuid=require(a:WaitForChild("\117\117\105\100"));wraptor=require(a:WaitForChild("\119\114\097\112\116\111\114"));into=function(a,C)C.value=a return a end}local P=C.t.tuple(C.t.table,C.t.callback)function C.bind(a,C)assert(P(a,C))return function(...)return C(a,...)end end C._prettyCheck=C.t.tuple(C.t.any,C.t.optional(C.t.integer))function C.repr(a,P)assert(C._prettyCheck(a,P))P=P or 0 local B={}local Z="    "if typeof(a)=="\116\097\098\108\101"then table.insert(B,"\123\n")for L,y in pairs(C.itertools.GetSortedKeys(a))do local G=Z:rep(P+1)local R=C.repr(a[y],P+1)table.insert(B,("\037\115 \037\115 \061 \037\115\n"):format(G,y,R))end table.insert(B,("\037\115\125"):format(Z:rep(P)))elseif typeof(a)=="\115\116\114\105\110\103"then table.insert(B,("\037\113 \040\115\116\114\105\110\103\041"):format(a))else table.insert(B,("\037\115 \040\037\115\041"):format(tostring(a),typeof(a)))end return table.concat(B)end return C
local stdFolder = script.Parent

local stdLib = {
    itertools = require(stdFolder:WaitForChild("itertools")),
    linq = require(stdFolder:WaitForChild("linq")),
    queue = require(stdFolder:WaitForChild("Queue")),
    randumb = require(stdFolder:WaitForChild("randumb")),
    rquery = require(stdFolder:WaitForChild("rquery")),
	stringobj = require(stdFolder:WaitForChild("stringobj")),
    t = require(stdFolder:WaitForChild("t")),
    uuid = require(stdFolder:WaitForChild("uuid")),
    wraptor = require(stdFolder:WaitForChild("wraptor")),
    into = function(value, into)
	    into.value = value
	    return value
    end
}

--[[
	Binds a method with its object so that it can be used independently.

	This is useful when exposing a method when you don't also want to attach the
	object to it. For example, when exporting an API.

	Usage:

		local obj = {
			str = "Example",
			foo = function(self)
				print(self.str)
			end
		}

		local method = bind(obj, obj.foo)

		print(method()) -- "Example"
]]


local bindCheck = stdLib.t.tuple(stdLib.t.table, stdLib.t.callback)

function stdLib.bind(obj, method)
	assert(bindCheck(obj, method))

	return function(...)
		return method(obj, ...)
	end
end

--[[
	Converts a value into a nicely formatted string.

	This is mostly used for tables as a way to inspect the contents. inspect.lua
	is the next best thing, but is a bit slow and bogs things down if used in
	succession. This function is a lot more lightweight.

	Usage:

		local t = {
			foo = true,
			bar = false
		}

		print(pretty(t))
]]

stdLib._prettyCheck = stdLib.t.tuple(stdLib.t.any, stdLib.t.optional(stdLib.t.integer))
function stdLib.repr(value, indentLevel)
	assert(stdLib._prettyCheck(value, indentLevel))

    indentLevel = indentLevel or 0

    local output = {}
    local indent = "    "

    if typeof(value) == "table" then
        table.insert(output, "{\n")

        for _, k in pairs(stdLib.itertools.GetSortedKeys(value)) do
			local indentation = indent:rep(indentLevel+1)
			local otherValue = stdLib.repr(value[k], indentLevel+1)

			table.insert(output, ("%s %s = %s\n"):format(indentation, k, otherValue))
        end

        table.insert(output, ("%s}"):format(indent:rep(indentLevel)))
    elseif typeof(value) == "string" then
		table.insert(output, ("%q (string)"):format(value))
    else
		table.insert(output, ("%s (%s)"):format(tostring(value), typeof(value)))
    end

    return table.concat(output)
end


return stdLib