Skip to content

Commit 7c77e03

Browse files
authored
Merge pull request #25 from garyb/mapthunk
Add 'mapThunk' for a combined hoist/map
2 parents ce7fb14 + 69e0e3c commit 7c77e03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Halogen/VDom/Thunk.purs

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module Halogen.VDom.Thunk
33
, buildThunk
44
, runThunk
55
, hoist
6+
, mapThunk
67
, thunked
78
, thunk1
89
, thunk2
@@ -32,7 +33,10 @@ instance functorThunk ∷ Functor f ⇒ Functor (Thunk f) where
3233
map f (Thunk a b c d) = Thunk a b (c >>> map f) d
3334

3435
hoist f g. (f ~> g) Thunk f ~> Thunk g
35-
hoist k (Thunk a b c d) = Thunk a b (c >>> k) d
36+
hoist = mapThunk
37+
38+
mapThunk f g i j. (f i -> g j) Thunk f i -> Thunk g j
39+
mapThunk k (Thunk a b c d) = Thunk a b (c >>> k) d
3640

3741
thunk a f i. Fn.Fn4 ThunkId (Fn.Fn2 a a Boolean) (a f i) a (Thunk f i)
3842
thunk = Fn.mkFn4 \tid eqFn f a →

0 commit comments

Comments
 (0)