dingo-core 0.0.3 → 0.0.3.1
raw patch · 3 files changed
+16/−4 lines, 3 files
Files
- dingo-core.cabal +4/−2
- src/Dingo/Internal/SessionTypes.hs +3/−2
- src/Dingo/Internal/TypeableShim.hs +9/−0
dingo-core.cabal view
@@ -1,5 +1,5 @@ Name: dingo-core-Version: 0.0.3+Version: 0.0.3.1 Synopsis: Dingo is a Rich Internet Application platform based on the Warp web server. Description: Dingo is a Rich Internet Application platform based on the Warp web server. It allows you to write code which looks very much like regular GUI code and have it work in the browser. @@ -44,7 +44,8 @@ , wai-extra == 0.4.* , warp == 0.4.* , web-css == 0.1.*- Extensions: DeriveDataTypeable+ Extensions: CPP+ DeriveDataTypeable ExistentialQuantification FunctionalDependencies GeneralizedNewtypeDeriving@@ -78,6 +79,7 @@ Dingo.Internal.Server.Wai Dingo.Internal.Session Dingo.Internal.SessionTypes+ Dingo.Internal.TypeableShim Dingo.Internal.Widget Dingo.Internal.WidgetSet Dingo.Internal.WidgetTypes
src/Dingo/Internal/SessionTypes.hs view
@@ -35,6 +35,7 @@ import Data.Text (Text) import Dingo.Internal.Base (CallbackId, WidgetId, succCallbackId, succWidgetId, zeroCallbackId, zeroWidgetId) import Dingo.Internal.ResourceBundle.Internal (ResourceBundle, ResourceBundleSet, elemResourceBundleSet, findResourceInBundleSet, resourceBundleSetFromList)+import Dingo.Internal.TypeableShim (TypeRepKey) import Dingo.Internal.WidgetSet (WidgetSet, emptyWidgetSet, setWidgetState, getWidgetState) import Dingo.Internal.WidgetTypes (Widget) @@ -45,7 +46,7 @@ , _widgetCounter :: WidgetId , _sessionCallbacks :: Map CallbackId c , _widgetSet :: WidgetSet- , _widgetTypeSet :: HashSet Int+ , _widgetTypeSet :: HashSet TypeRepKey , _resourceBundleSet :: ResourceBundleSet } @@ -110,7 +111,7 @@ -- Check if a widget type is registered in the session, -- and register it if not. Returns -- true iff the bundle was not previously registered.-registerWidgetType :: (Monad m, Functor m) => Int -> SessionT c m Bool+registerWidgetType :: (Monad m, Functor m) => TypeRepKey -> SessionT c m Bool registerWidgetType widgetTypeRepKey = SessionT $ do e <- fmap (S.member widgetTypeRepKey) $ gets widgetTypeSet unless e $ modify widgetTypeSet $ S.insert widgetTypeRepKey
+ src/Dingo/Internal/TypeableShim.hs view
@@ -0,0 +1,9 @@+module Dingo.Internal.TypeableShim+ ( TypeRepKey+ ) where++#if __GLASGOW_HASKELL__ >= 720+import Data.Typeable (TypeRepKey)+#else+type TypeRepKey = Int+#endif