How can I define a function that will accept my type and return its primitive "synonym"? For instance:
newtype MyInt = MakeInt Int
And I want a function:
unMyInt :: MakeInt -> Int
By figurative comparison of the constructor:
unMyInt (MakeInt i) = i
Another (and more convenient way sometimes) is to write syntax:
newtype myInt a = MyInt { unMyInt :: Int }
This automatically determines the function
unMyInt :: MyInt -> Int
Source: https://habr.com/ru/post/1766873/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1766868/trying-to-integrate-some-apps-to-my-project&usg=ALkJrhg94O4-XhOrf2vneH0gp23E6e3ugwHow to accept programming code input to display goals? - htmlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1766870/deleting-committed-username-and-password-from-bitbucket-repository&usg=ALkJrhhVarztTuDnVqvXTxr12cpJbTqiHQhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1766871/jquery-ui-dialog-how-to-add-tabs-to-content-area&usg=ALkJrhhBF9AE_FsLo1YGgLQCuyhQNr7NSAWhat is the philosophy of literals in programming? - c #Dismissing multiple onClick events - htmlWhy is it acceptable to expect Flash to be available / enabled, but not JavaScript? - javascriptHow to display an array of UILabels? - iphoneHow to get started with extracting information? - nlpZedGraph Axis Labels - zedgraphAll Articles