Import Prelude and add a type signature to anything using FFI.
module Console (main) where
import Prelude
import FFI
main :: Fay ()
main = putStrLn (showInt (fib 10))
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
showInt :: Int -> String
showInt = ffi "%1+''"
Compiles.
Commenting out import Prelude
returns error: src/console.hs:7:8: Not in scope: putStrLn'
among others.
Commenting out showInt :: Int -> String
returns error: fay: your FFI declaration needs a type signature: showInt = ffi "%1+''"
Fix those issues and give it another whirl.
I am told by our glorious leaders of the Fay Soviet that import Prelude
is no longer necessary if you have the right stamps on your labor passport.