Skip to content

How does the inferring work on this line? #16

@coodoo

Description

@coodoo

printf fmt = printfFmt _ ""

Use an underscore (_) for the format, because Idris can infer from the type that it must be toFormat (unpack fmt).

This's the explanation from the book for above line but I'm still a bit puzzled by how does the inferring work here? Since fmt comes in as a String type, how does it become a Format type when passed to printfFmt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions