A metatable can be defined like
local t = setmetatable({}, {
__tostring = function() return 'custom tostring behavior!' end
})Here are the metamethods that you can define, and their behavior
| This is a tutorial on the Curry-Howard correspondence, or the correspondence | |
| between logic and type theory, written by Keith Pinson, who is still a learner | |
| on this subject. If you find an error, please let me know. | |
| This is a Bird-style literate Haskell file. Everything is a comment by default. | |
| Lines of actual code start with `>`. I recommend that you view it in an editor | |
| that understands such things (e.g. Emacs with `haskell-mode`). References will | |
| also be made to Scala, for programmers less familiar with Haskell. | |
| We will need to turn on some language extensions. This is not an essay on good |
| ### Keybase proof | |
| I hereby claim: | |
| * I am vitalibarozzi on github. | |
| * I am vitalibarozzi (https://keybase.io/vitalibarozzi) on keybase. | |
| * I have a public key ASC8uJyhGpAipPucMMy_Ksi0wpS-DfAYVYlCQKo23O9DFwo | |
| To claim this, I am signing this object: |