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
class Foo { | |
} |
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
if ((((notification.orderID == orderID) | |
|| (notification.customerID == customerID) | |
|| (eventIDs.contains(notification.eventID)) && (notification.type.toAllStaff || notification.type.toAllOrders)) | |
|| (isAdmin && eventIDs.contains(notification.eventID)) | |
&& (userID != notification.senderID || notification.senderID == null))) { | |
send(notification); | |
} | |
// |
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
plusOne :: Maybe (Int -> Int) | |
plusOne = Just (+ 1) |
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
plusOne :: Int -> Maybe Int | |
plusOne x = Just (x + 1) |
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
plusOne :: Int -> Int | |
plusOne x = x + 1 |
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
withMonad :: Int -> String -> Maybe String | |
withMonad age name = do | |
validateAge age | |
s <- return (greet name) | |
return (greet s) -- Just "Hello Hello John" |
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
withMonad :: Int -> String -> Maybe String | |
withMonad age name = do | |
validateAge age | |
return (greet name) |
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
withMonad :: Int -> String -> Maybe String | |
withMonad age name = validateAge age >>= \_ -> return (greet name) |
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
withApplicative :: Int -> String -> Maybe String | |
withApplicative age name = greet <$> (Just name) <*> validateAge age |
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
validateAge :: Int -> Maybe Int | |
validateAge age | |
| age >= 18 = return age | |
| otherwise = Nothing | |
greet :: String -> String | |
greet name = "Hello " ++ name |
NewerOlder