-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
yes p1 p2 | ||
| g1 = e1 | ||
|
||
|
||
foo = 3 | ||
where | ||
yes p1 p2 | ||
| g1 = e1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
module Operator where | ||
|
||
main :: IO () | ||
main = do | ||
print $ 3 + 4 | ||
-- lets make sure | ||
print $ foo || | ||
-- that comments end up in the right place | ||
bar || | ||
baz && | ||
-- even this one | ||
quux | ||
|
||
-- lets also make sure | ||
print $ foo | ||
-- that these comments end up in the right place | ||
|| bar | ||
|| baz | ||
-- even when the operator is leading | ||
&& quux | ||
|
||
return ({- comment -} x >= 1 || y >= 2) | ||
|
||
print $ foo || bar | ||
print $ foo || bar | ||
print $ foo || bar | ||
print $ {- comment here -} foo || bar | ||
print $ foo {- comment here -} || bar | ||
print $ foo || {- comment here -} bar | ||
print $ foo || bar {- comment here -} | ||
|
||
print $ foo || bar | ||
print $ foo || bar | ||
|
||
{-# RULES "print" forall x. putStrLn $ show $ x = print $ x #-} | ||
|
||
f :: Int -> Bool | ||
f x = x == 2 | ||
|
||
g :: Int -> Bool | ||
g y = (y == 2) /= False | ||
|
||
roundtrip :: IO [a] | ||
roundtrip = return $ mconcat | ||
[ timeToText $ time_enrolled - mod time_enrolled t | ||
, ":" | ||
] | ||
|
||
-- Ensure local fixity declarations are handled properly | ||
(.@@@) :: (a -> b) -> a -> b | ||
f .@@@ x = f x | ||
|
||
infixr 0 .@@@ | ||
{-# RULES "printAt" forall x. putStrLn .@@@ show .@@@ x = print $ x #-} |