Emoji

As of March 2020, School of Haskell has been switched to read-only mode.

While it's not possible to use emoji as regular names in Haskell

{-# START_FILE Main.hs #-}
๐Ÿ’ฉ = "emoji"

main = print emoji

They can be used as infix function names

{-# START_FILE Main.hs #-}
(๐Ÿ†) = (+)

main = print $ 3 ๐Ÿ† 4
                          
{-# START_FILE Main.hs #-}
infixr 5 ๐Ÿ‘‰

(๐Ÿ‘‰) = (:)
(๐Ÿ‘Œ) = []

main = putStrLn $ 'e' ๐Ÿ‘‰ 'm' ๐Ÿ‘‰ 'o' ๐Ÿ‘‰ 'j' ๐Ÿ‘‰ 'i' ๐Ÿ‘‰ (๐Ÿ‘Œ)
                          

Can you guess what the โœŒ and ๐Ÿ“ฉ functions do?

{-# START_FILE Main.hs #-}

import Data.Time.Clock.POSIX

getTime = round `fmap` getPOSIXTime

(๐Ÿ“ฉ) :: Functor f => (a -> b) -> f a -> f b
(๐Ÿ“ฉ) = fmap
(โœŒ) = (* 2)

-- show

main = do
    print $ (โœŒ) 100
    print $ (โœŒ) ๐Ÿ“ฉ [1..5]
    print $ (โœŒ) ๐Ÿ“ฉ Just 10

    time <- getTime
    print time

    punTime <- (โœŒ) ๐Ÿ“ฉ getTime
    print punTime

-- /show