Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does the inferring work on this line? #16

Open
coodoo opened this issue Jan 22, 2019 · 0 comments
Open

How does the inferring work on this line? #16

coodoo opened this issue Jan 22, 2019 · 0 comments

Comments

@coodoo
Copy link

coodoo commented Jan 22, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant