Skip to content

Commit e11ecc5

Browse files
authored
Updates for 0.11 (#16)
1 parent 87f145a commit e11ecc5

File tree

7 files changed

+30
-31
lines changed

7 files changed

+30
-31
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: node_js
22
dist: trusty
33
sudo: required
4-
node_js: 5
4+
node_js: stable
55
install:
66
- npm install
77
- npm install -g bower

bower.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@
2222
"output"
2323
],
2424
"dependencies": {
25-
"purescript-prelude": "^2.1.0",
26-
"purescript-eff": "^2.0.0",
27-
"purescript-tuples": "^3.0.0",
28-
"purescript-dom": "^3.3.0",
29-
"purescript-maps": "^2.0.1",
30-
"purescript-maybe": "^2.0.1",
31-
"purescript-unsafe-coerce": "^2.0.0",
32-
"purescript-bifunctors": "^2.0.0",
33-
"purescript-refs": "^2.0.0",
34-
"purescript-foreign": "^3.0.1"
25+
"purescript-prelude": "^3.0.0",
26+
"purescript-eff": "^3.0.0",
27+
"purescript-tuples": "^4.0.0",
28+
"purescript-dom": "^4.0.0",
29+
"purescript-maps": "^3.0.0",
30+
"purescript-maybe": "^3.0.0",
31+
"purescript-unsafe-coerce": "^3.0.0",
32+
"purescript-bifunctors": "^3.0.0",
33+
"purescript-refs": "^3.0.0",
34+
"purescript-foreign": "^4.0.0"
3535
},
3636
"devDependencies": {
37-
"purescript-psci-support": "^2.0.0",
38-
"purescript-js-timers": "^2.0.0",
39-
"purescript-exists": "^2.0.0"
37+
"purescript-js-timers": "^3.0.0",
38+
"purescript-exists": "^3.0.0"
4039
}
4140
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"build": "pulp build -- --censor-lib --strict"
77
},
88
"devDependencies": {
9-
"pulp": "^10.0.0",
10-
"purescript": "^0.10.2",
11-
"purescript-psa": "^0.4.0",
9+
"pulp": "^11.0.0",
10+
"purescript": "^0.11.1",
11+
"purescript-psa": "^0.5.1",
1212
"rimraf": "^2.5.4"
1313
}
1414
}

src/Halogen/VDom/DOM/Prop.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ instance functorElemRef ∷ Functor ElemRef where
4949
map f (Created a) = Created (f a)
5050
map f (Removed a) = Removed (f a)
5151

52-
foreign import data PropValue*
52+
foreign import data PropValueType
5353

5454
propFromString String PropValue
5555
propFromString = unsafeCoerce

src/Halogen/VDom/Types.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ instance bifunctorVDom ∷ Bifunctor VDom where
4141
bimap f g (Grafted a) = Grafted (bimap f g a)
4242
bimap f g a = Grafted (graft (Graft f g a))
4343

44-
foreign import data Graft* * *
44+
foreign import data GraftType Type Type
4545

4646
instance functorGraftFunctor (Graft a) where
4747
map g = unGraft \(Graft f' g' a) → graft (Graft f' (g <<< g') a)

src/Halogen/VDom/Util.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,6 @@ foreign import addEventListener
170170
foreign import removeEventListener
171171
eff. Fn.Fn3 String (DOM.EventListener (dom DOM | eff)) DOM.Element (Eff (dom DOM | eff) Unit)
172172

173-
foreign import data JsUndefined*
173+
foreign import data JsUndefinedType
174174

175175
foreign import jsUndefined JsUndefined

test/Main.purs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module Test.Main where
22

33
import Prelude
4-
import Control.Monad.Eff (Eff)
4+
import Control.Monad.Eff (Eff, kind Effect)
55
import Control.Monad.Eff.Ref (REF)
66
import Control.Monad.Eff.Ref as Ref
77
import Control.Monad.Eff.Timer as Timer
88
import Data.Exists (Exists, mkExists, runExists)
99
import Data.Maybe (Maybe(..), isNothing)
10-
import Data.Nullable (toMaybe)
10+
import Data.Newtype (wrap)
1111
import Data.Foldable (for_, traverse_)
1212
import Data.Function.Uncurried as Fn
1313
import Data.Tuple (Tuple)
@@ -113,15 +113,15 @@ buildWidget
113113
V.VDomMachine (dom DOM, ref REF | eff) (Exists Thunk) DOM.Node
114114
buildWidget spec = render
115115
where
116-
render = runExists \(Thunk a render) → do
117-
V.Step node m h ← V.buildVDom spec (render a)
116+
render = runExists \(Thunk a render') → do
117+
V.Step node m h ← V.buildVDom spec (render' a)
118118
pure (V.Step node (Fn.runFn4 patch (unsafeCoerce a) node m h) h)
119119

120-
patch = Fn.mkFn4 \a node step halt → runExists \(Thunk b render) →
120+
patch = Fn.mkFn4 \a node step halt → runExists \(Thunk b render') →
121121
if Fn.runFn2 refEq a b
122122
then pure (V.Step node (Fn.runFn4 patch a node step halt) halt)
123123
else do
124-
V.Step node' m h ← step (render b)
124+
V.Step node' m h ← step (render' b)
125125
pure (V.Step node' (Fn.runFn4 patch (unsafeCoerce b) node' m h) h)
126126

127127
mkSpec
@@ -134,7 +134,7 @@ mkSpec document = V.VDomSpec
134134
, document
135135
}
136136

137-
foreign import data DBMON!
137+
foreign import data DBMONEffect
138138

139139
foreign import getData eff. Eff (dbmon DBMON | eff) State
140140

@@ -153,7 +153,7 @@ mkRenderQueue
153153
Eff (dom DOM, ref REF | eff) (a Eff (dom DOM, ref REF | eff) Unit)
154154
mkRenderQueue spec parent render initialValue = do
155155
initMachine ← V.buildVDom spec (render initialValue)
156-
DOM.appendChild (V.extract initMachine) parent
156+
_ ← DOM.appendChild (V.extract initMachine) parent
157157
ref ← Ref.newRef initMachine
158158
val ← Ref.newRef Nothing
159159
pure \a → do
@@ -175,7 +175,7 @@ mkRenderQueue'
175175
Eff (dom DOM, ref REF | eff) (a Eff (dom DOM, ref REF | eff) Unit)
176176
mkRenderQueue' spec parent render initialValue = do
177177
initMachine ← V.buildVDom spec (render initialValue)
178-
DOM.appendChild (V.extract initMachine) parent
178+
_ ← DOM.appendChild (V.extract initMachine) parent
179179
ref ← Ref.newRef initMachine
180180
pure \v → do
181181
machine ← Ref.readRef ref
@@ -186,8 +186,8 @@ main :: ∀ eff. Eff (ref ∷ REF, dom ∷ DOM, dbmon ∷ DBMON, timer ∷ Timer
186186
main = do
187187
win ← DOM.window
188188
doc ← DOM.document win
189-
bod ← DOM.querySelector "body" (DOM.htmlDocumentToParentNode doc)
190-
for_ (toMaybe bod) \body → do
189+
bod ← DOM.querySelector (wrap "body") (DOM.htmlDocumentToParentNode doc)
190+
for_ bod \body → do
191191
let spec = mkSpec (DOM.htmlDocumentToDocument doc)
192192
pushQueue ← mkRenderQueue' spec (DOM.elementToNode body) renderData initialState
193193
let

0 commit comments

Comments
 (0)