Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- == The problem ==
- We do it all the time: Writing that one dollar sign just before our expressions, just because Haskell can't parse it:
- {{{#!hs
- f x = g $ if x then {- ... -} else {- ... -}
- f x = g $ case x of {- ... -}
- f x = g $ do {- ... -}
- }}}
- However, we programmers are lazy and want to type as few characters as possible. Think about the precious characters we would save if we could write code this way:
- {{{#!hs
- f x = g if x then {- ... -} else {- ... -}
- f x = g case x of {- ... -}
- f x = g do {- ... -}
- }}}
- Wow, our productivity just shot up by a whopping 6%!
- However, this code looks ugly, noone would ever write this... Right?
- There has to be some way to catagorize this feature with others people would never use...
- == Pragmas to the rescue! ==
- The {{{LANGUAGE}}} pragma! Of course! We can add a syntactic extension to enable above syntax! But how should we name it...
- {{{InlineStatements}}}? {{{InfixStatements}}}? {{{ParenthesizedStatements}}}? {{{IncreasedStatementPrecedence}}}? {{{StatementsWithoutParenthesis}}}?
- I don't know. I am [1] not the parents who might one day give birth to this feature. I am merely the one who conceptualized it.
- [1] (probably, unless this request remains unnoticed for another 20 years or so)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement