fay is an actively used programming language created in 2012.

7Years Old 1,446Users 0Jobs
  • fay ranks in the top 50% of languages
  • the fay website
  • fay on github
  • fay first appeared in 2012
  • the fay team is on twitter
  • I have 23 facts about fay. what would you like to know? email me and let me know how I can help.

Example code from the web:

{-# LANGUAGE EmptyDataDecls #-}
module Hello where

import FFI

data Event

alert :: String -> Fay ()
alert = ffi "alert(%1)"

setBodyHtml :: String -> Fay ()
setBodyHtml = ffi "document.body.innerHTML = %1"

addWindowEvent :: String -> (Event -> Fay ()) -> Fay ()
addWindowEvent = ffi "window.addEventListener(%1, %2)"

greet :: Event -> Fay ()
greet event = do
  putStrLn "The document has loaded"
  setBodyHtml "Hello HTML!"

main :: Fay ()
main = do
  putStrLn "Hello Console!"
  alert "Hello Alert!"
  addWindowEvent "load" greet 

Last updated November 6th, 2019