Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marc Coiffier
BHR
Commits
015640da
Commit
015640da
authored
May 22, 2019
by
Marc Coiffier
Browse files
Use the safer Foreign.Concurrent.ForeignPtr with the GTK bindings in definitive-graphics
parent
cf2e953c
Changes
1
Hide whitespace changes
Inline
Side-by-side
definitive-graphics/source/Graphics/Widget/Traits.hs
View file @
015640da
...
...
@@ -22,7 +22,8 @@ module Graphics.Widget.Traits(
import
Definitive
import
Foreign.Ptr
import
Foreign.ForeignPtr
import
Foreign.ForeignPtr
hiding
(
newForeignPtr
)
import
Foreign.Concurrent
import
IO.Time
(
Seconds
)
import
Graphics.GDK.KeyCodes
import
IO.Dynamic
...
...
@@ -38,8 +39,7 @@ data WProps a = WProps {
_wPropsValue
::
a
}
nullWidgetPtr
=
thunk
$^
do
cb
<-
callback_p_
(
const
unit
)
newForeignPtr
cb
nullPtr
newForeignPtr
nullPtr
unit
instance
Functor
WProps
where
map
f
(
WProps
h
a
)
=
WProps
h
(
f
a
)
instance
Unit
WProps
where
pure
x
=
WProps
nullWidgetPtr
x
instance
SemiApplicative
WProps
where
WProps
h
f
<*>
WProps
h'
x
=
WProps
(
max
h
h'
)
(
f
x
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment