unfunction()

    Unfunction lets you see through layers of abstraction by showing function calls as if they were written inline. Simply click an underlined function or type. Works with TypeScript.

    Notation

    TypeScript NotationOur Notation
    { name: string,
    age: number,
    [otherField: string]: boolean }
    namestring
    agenumber
    otherFieldboolean
    string[]indexstring
    function doubleNum(x) {
    return x * 2
    }
    let y = doubleNum(5)
    function doubleNum(x) {
    return x * 2
    }
    let y = doubleNum(5)

    Examples

    Basic

    Click to expand the function calls.

    function threeTimesNum(x: number) {
    return x * 3
    }
    function sixTimesNum(x: number) {
    return threeTimesNum(x) * 2
    }
    let z = sixTimesNum(5)
    Substitution

    Inputs are paramaterized when needed.

    function twoTimesNum(x: number) {
    return x * 2
    }
    function squareNum(x: number) {
    return x * x
    }
    let z = squareNum(twoTimesNum(5))
    Limitations

    Limitations (right example) arise from first-class functions with implicit parameters (NP-hard to track). TS doesn't have ownership like rust, so it itself to deal with async/await.

    Even with this limitation, expansion is useful to see the the shape of primitive calls in your code. Usually in complex scenarios you just want to look at the code anyway.

    type User =
    namestring
    agenumber
    function doThingsToUser(user: User, ...fns:
    index(User)undefined
    ) {
    for (const f of fns) {f(user)}
    }
    function setUserName(user: User) {
    user.name = 'Bob'
    }
    let user = { name: 'Max', age: 99 }
    doThingsToUser(user, setUserName)
    TypeScript to make expandable below:
    function threeTimesNum(x: number) {
    return x * 3
    }
    function sixTimesNum(x: number) {
    return threeTimesNum(x) * 2
    }
    let z = sixTimesNum(5)

    All Types

    No types loaded
    See it on real code!