Skip to content

Commit ab2c939

Browse files
committed
Rename Language.Fay.FFI to Fay.FFI
1 parent f0b6e50 commit ab2c939

File tree

9 files changed

+18
-23
lines changed

9 files changed

+18
-23
lines changed

fay.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ category: Development
2929
build-type: Custom
3030
cabal-version: >=1.8
3131
data-files: js/runtime.js
32-
src/Language/Fay/FFI.hs
32+
src/Fay/FFI.hs
3333
extra-source-files: examples/ref.hs examples/alert.hs examples/console.hs examples/dom.hs
3434
examples/tailrecursive.hs examples/data.hs examples/canvaswater.hs
3535
examples/canvaswater.html examples/haskell.png
@@ -337,7 +337,7 @@ library
337337
, Fay.Compiler.Debug
338338
, Fay.Convert
339339
, Fay.Types
340-
, Language.Fay.FFI
340+
, Fay.FFI
341341
other-modules: Control.Monad.Extra
342342
, Control.Monad.IO
343343
, Data.List.Extra

js/runtime.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function Fay$$fayToJs(type,fayObj){
214214
}
215215
else if(base == "defined") {
216216
fayObj = Fay$$_(fayObj);
217-
if (fayObj instanceof Language.Fay.FFI._Undefined) {
217+
if (fayObj instanceof Fay.FFI._Undefined) {
218218
jsObj = undefined;
219219
} else {
220220
jsObj = Fay$$fayToJs(args[0],fayObj.slot1);
@@ -223,7 +223,7 @@ function Fay$$fayToJs(type,fayObj){
223223
}
224224
else if(base == "nullable") {
225225
fayObj = Fay$$_(fayObj);
226-
if (fayObj instanceof Language.Fay.FFI._Null) {
226+
if (fayObj instanceof Fay.FFI._Null) {
227227
jsObj = null;
228228
} else {
229229
jsObj = Fay$$fayToJs(args[0],fayObj.slot1);
@@ -347,17 +347,17 @@ function Fay$$jsToFay(type,jsObj){
347347
}
348348
else if(base == "defined") {
349349
if (jsObj === undefined) {
350-
fayObj = new Language.Fay.FFI._Undefined();
350+
fayObj = new Fay.FFI._Undefined();
351351
} else {
352-
fayObj = new Language.Fay.FFI._Defined(Fay$$jsToFay(args[0],jsObj));
352+
fayObj = new Fay.FFI._Defined(Fay$$jsToFay(args[0],jsObj));
353353
}
354354

355355
}
356356
else if(base == "nullable") {
357357
if (jsObj === null) {
358-
fayObj = new Language.Fay.FFI._Null();
358+
fayObj = new Fay.FFI._Null();
359359
} else {
360-
fayObj = new Language.Fay.FFI.Nullable(Fay$$jsToFay(args[0],jsObj));
360+
fayObj = new Fay.FFI.Nullable(Fay$$jsToFay(args[0],jsObj));
361361
}
362362

363363
}

src/Fay/Compiler.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ generateExports = do
213213
-- | Is the module a standard module, i.e., one that we'd rather not
214214
-- output code for if we're compiling separate files.
215215
anStdlibModule :: ModuleName -> Bool
216-
anStdlibModule (ModuleName name) = name `elem` ["Prelude","FFI","Language.Fay.FFI","Data.Data"]
216+
anStdlibModule (ModuleName name) = name `elem` ["Prelude","FFI","Fay.FFI","Data.Data"]
217217

218218
-- | Compile the given import.
219219
compileImport :: ImportDecl -> Compile [JsStmt]

src/Fay/Compiler/Misc.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ findImport alldirs mname = go alldirs mname where
304304

305305
stdlibHack
306306
| mname == ModuleName "Language.Fay.Stdlib" = \s -> s ++ "\n\ndata Maybe a = Just a | Nothing"
307-
| mname == ModuleName "Language.Fay.FFI" = const "module Language.Fay.FFI where\n\ndata Nullable a = Nullable a | Null\n\ndata Defined a = Defined a | Undefined"
307+
| mname == ModuleName "Fay.FFI" = const "module Fay.FFI where\n\ndata Nullable a = Nullable a | Null\n\ndata Defined a = Defined a | Undefined"
308308
| otherwise = id
309309

310310
-- | Run the compiler.
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
22
{-# LANGUAGE TypeSynonymInstances #-}
33

4-
-- | The internal FFI module. Needs to be renamed to Fay.FFI at some point.
4+
-- | The internal FFI module.
55

6-
module Language.Fay.FFI
6+
module Fay.FFI
77
(Fay
88
,Nullable (..)
99
,Defined (..)
@@ -13,8 +13,7 @@ module Language.Fay.FFI
1313
where
1414

1515
import Fay.Types
16-
import Prelude (Bool, Char, Double, Int, Maybe, String,
17-
error)
16+
import Prelude (Bool, Char, Double, Int, Maybe, String, error)
1817

1918
-- | Values that may be null
2019
-- Nullable x decodes to x, Null decodes to null.
@@ -47,4 +46,4 @@ type Automatic a = a
4746
-- | Declare a foreign action.
4847
ffi :: String -- ^ The foreign value.
4948
-> a -- ^ Bottom.
50-
ffi = error "Language.Fay.FFI.foreignFay: Used foreign function not in a JS engine context."
49+
ffi = error "Fay.FFI.ffi: Used foreign function outside a JS engine context."

tests/Hierarchical/Export.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
2-
31
module Hierarchical.Export where
42

5-
import Language.Fay.FFI
3+
import FFI
64
import Prelude
75

86
exported :: String

tests/Hierarchical/RecordDefined.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
2-
31
module Hierarchical.RecordDefined where
42

5-
import Language.Fay.FFI
3+
import FFI
64
import Prelude
75

86
data Callback a = Callback Double

tests/ImportList1/A.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ImportList1.A where
22

33
import Prelude
4-
import Language.Fay.FFI
4+
import FFI
55

66
x :: Double
77
x = 1

tests/ImportList1/B.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ImportList1.B where
22

33
import Prelude
4-
import Language.Fay.FFI
4+
import FFI
55

66
x :: Double
77
x = 2

0 commit comments

Comments
 (0)