Advertisement
Guest User

Untitled

a guest
Jul 25th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Main where
  2.  
  3. import Data.String.Utils
  4.  
  5. main :: IO ()
  6. main =
  7.     print [
  8.         check_googler_by email | email <- [ "[email protected]",
  9.                                             "[email protected]",
  10.                                             "[email protected]" ]]
  11.  
  12. ends_with :: String -> String -> Bool
  13. ends_with str suffix = suffix `endswith` str
  14.  
  15. check_googler_by :: String -> String
  16. check_googler_by email =
  17.     if email `ends_with` "gmail.com"
  18.     then name_from email ++ " is a Googler"
  19.     else email
  20.     where name_from = \full_email -> takeWhile (/= '@') full_email
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement