fay-geoposition 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+22/−19 lines, 3 filesdep +fay-basedep −basedep −faydep −time
Dependencies added: fay-base
Dependencies removed: base, fay, time
Files
- CHANGELOG.md +8/−0
- fay-geoposition.cabal +4/−6
- src/Fay/GeoPosition.hs +10/−13
CHANGELOG.md view
@@ -1,5 +1,13 @@ ## Changelog +## 0.1.0.1 (2015-06-11)++* Fix Fay bug that does not like type-aliasing++ Fay will generate JavaScript that will silently fail upon+ using a type-alias for the action signatures used in the+ callbacks.+ ## 0.1.0.0 (2015-05-31) * Initial release
fay-geoposition.cabal view
@@ -6,7 +6,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.0+version: 0.1.0.1 synopsis: W3C compliant implementation of GeoPosition API. description: W3C compliant implementation of GeoPosition API within the Fay Monad@@ -16,7 +16,7 @@ license-file: LICENSE author: Edward O'Callaghan maintainer: eocallaghan@alterapraxis.com--- copyright: +copyright: (c) 2015 Altera Praxis Pty Ltd category: Web build-type: Simple data-files: src/Fay/GeoPosition.hs@@ -27,11 +27,9 @@ README.md library- exposed: False exposed-modules: Fay.GeoPosition- other-extensions: CPP, DeriveDataTypeable, FlexibleInstances, StandaloneDeriving- build-depends: base >=4.7 && <4.8, time >=1.4 && <1.5,- fay, fay-text+ other-extensions: CPP+ build-depends: fay-base, fay-text hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall
src/Fay/GeoPosition.hs view
@@ -17,9 +17,9 @@ module Fay.GeoPosition ( geoPositionErrorMessage , geoPositionErrorCode-#ifdef FAY+-- #ifdef FAY , initGeoPosition-#endif+-- #endif , GeoPositionCallbacks(..) , GeoPositionOptions(..) , GeoPosition(..)@@ -31,16 +31,16 @@ import Fay.Text (Text,unpack)-#ifdef FAY+-- #ifdef FAY import FFI import Data.Nullable (toNullable)-#endif+-- #endif import Data.Time (UTCTime) import Data.Data import Prelude -#ifdef FAY+-- #ifdef FAY -- | Call to initialise GeoPosition API with callback -- actions to be taken upon success or error. initGeoPosition :: GeoPositionCallbacks Fay@@ -48,8 +48,8 @@ -> Fay () initGeoPosition gpc gpo = do getCurrentPosition' gpc's gpc'e gpc'o- where getCurrentPosition' :: GeoPositionCallback Fay- -> Nullable (GeoPositionErrorCallback Fay)+ where getCurrentPosition' :: (GeoPosition -> Fay ())+ -> Nullable (GeoPositionError -> Fay ()) -> Nullable GeoPositionOptions -> Fay () getCurrentPosition' = ffi "navigator.geolocation.getCurrentPosition(%1,%2,%3)"@@ -57,17 +57,14 @@ gpc'e = toNullable (geoPositionErrorCallback gpc) gpc'o = toNullable gpo -#endif+-- #endif -- | See section [5.1 - W3C Geolocation API] -- Requires the monad type that the callbacks have action on-data GeoPositionCallbacks m = GeoPositionCallbacks { geoPositionCallback :: GeoPositionCallback m- , geoPositionErrorCallback :: Maybe (GeoPositionErrorCallback m)+data GeoPositionCallbacks m = GeoPositionCallbacks { geoPositionCallback :: GeoPosition -> m ()+ , geoPositionErrorCallback :: Maybe (GeoPositionError -> m ()) }--type GeoPositionCallback m = GeoPosition -> m ()-type GeoPositionErrorCallback m = GeoPositionError -> m () -- | See section [5.2 - W3C Geolocation API] data GeoPositionOptions =