In the Wiki page for Sudoku solutions, one solution claims to use the “Dot Hack”. The linked Github page is no more available and I couldn’t find anything about it elewhere.
What is this about? What does it do? How?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I guess he’s referring to the following line:
which disables the normal
(.)operator for functional composition. Instead, another operator with the same name is used, probably imported from the utility moduleT.T. This operator behaves like in OOP languages:which (I think) would normally look like
That operator works the same like the
|>operator in F#:which is used to pipe a value through functions (and is more readable and better functional style, imo):
(|>)is also the same asflip ($).Edit: This “hacked” operator already exists in Haskell, somehow. The same composition behavior can be achieved by the left-to-right composition operator from
Control.Category:This pipes only functions, though, and is actually just
f >>> g = g . f.