Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No fromInteger support #20

Closed
MasseR opened this issue Jul 24, 2012 · 1 comment
Closed

No fromInteger support #20

MasseR opened this issue Jul 24, 2012 · 1 comment
Assignees
Labels

Comments

@MasseR
Copy link

MasseR commented Jul 24, 2012

I see references to fromInteger in Prelude, which if I understood correctly is for changing types for GHC. However there is no handling for them on the javascript-side. I haven't tested, but I assume fromRational suffers from the same problem.

{-# LANGUAGE NoImplicitPrelude #-}
module Test where

import Language.Fay.Prelude
import Language.Fay.FFI

print :: Foreign a => a -> Fay ()
print = foreignFay "console.log" ""

main :: Fay ()
main = print $ show $ fromInteger 5

ReferenceError: fromInteger is not defined

@chrisdone
Copy link
Contributor

Right, I suppose we perfectly reasonably define fromInteger and fromRational to be id or something on the JS side. There's only Doubles in JS, so we don't have to care about different number types.

@ghost ghost assigned chrisdone Jul 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants