I've recently come across a bot on Twitter named EmojiHaskell, that claims to tweet 'interpretable Haskell code with emoji variable names'. A particular Tweet caught my attention, as it looked like malformed syntax to me, so I decided to take a closer look. So far I've produced the following code:
module Main where
π :: [π³] -> Maybe π³
π [] = Nothing
π (π½:as) = Just π½
main = print $ π "β₯"
Since I've used Ξ»
on occasion in my Haskell code, I expected this code to work, but it appears that GHC doesn't like the emoji at all.
With $ runhaskell Main.hs
I get:
Main.hs:4:1: parse error on input βπβ
I've already had a look at the UnicodeSyntax extension, and tried to only use some or single emoji instead of all of them to see if a certain one provokes the problem.
Now my question is this: Is there currently a Haskell compiler that would accept the code? Can I get GHC to work with this code somehow?
->
withβ
, and so on. It is not required just to use Unicode characters in your source code. downloads.haskell.org/~ghc/latest/docs/html/users_guide/…