Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (14 sloc) 0.455 kB
{-# LANGUAGE NoImplicitPrelude #-}
module List2 where
import Language.Fay.FFI
import Language.Fay.Prelude
main = print (showList (take 5 (let ns = 1 : map' (foo 123) ns in ns)))
foo x y = x * y / 2
take 0 _ = []
take n (x:xs) = x : take (n - 1) xs
map' f [] = []
map' f (x:xs) = f x : map' f xs
print :: String -> Fay ()
print = ffi "console.log(%1)"
showList :: [Double] -> String
showList = ffi "JSON.stringify(%1)"
Jump to Line
Something went wrong with that request. Please try again.