Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
3c9dec70
Commit
3c9dec70
authored
Aug 05, 2021
by
David Davó
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ByteString: Removed orphan
parent
1f772ccb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
Types.hs
...ay/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
+10
-4
No files found.
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
View file @
3c9dec70
...
...
@@ -69,6 +69,7 @@ import Control.Applicative ((<$>))
import
qualified
Control.Exception
as
Ex
import
Data.Typeable
(
Typeable
,
TypeRep
,
typeOf
)
import
Data.IORef
(
IORef
,
readIORef
,
modifyIORef
)
import
Data.String
import
Data.Text
(
Text
,
pack
)
import
System.IO.Error
import
System.Posix.IO
...
...
@@ -197,7 +198,7 @@ type instance FieldType 'S.Placeholder = Text
type
instance
FieldType
'S
.
Tooltip
=
Maybe
Text
type
instance
FieldType
'S
.
Icon
=
Text
type
instance
FieldType
'S
.
ButtonStyle
=
ButtonStyleValue
type
instance
FieldType
'S
.
BSValue
=
ByteString
type
instance
FieldType
'S
.
BSValue
=
JSON
ByteString
type
instance
FieldType
'S
.
ImageFormat
=
ImageFormatValue
type
instance
FieldType
'S
.
BoolValue
=
Bool
type
instance
FieldType
'S
.
OptionsLabels
=
[
Text
]
...
...
@@ -502,9 +503,14 @@ instance HasKey f ~ 'False => ToPairs' 'False f where
instance
(
ToJSON
(
FieldType
f
),
HasKey
f
~
'T
r
ue
)
=>
ToPairs'
'T
r
ue
f
where
toPairs'
x
=
[
pack
(
toKey
$
_field
x
)
.=
toJSON
x
]
newtype
JSONByteString
=
JSONByteString
ByteString
deriving
(
Eq
,
Ord
)
instance
ToJSON
ByteString
where
toJSON
=
toJSON
.
base64
instance
ToJSON
JSONByteString
where
toJSON
(
JSONByteString
x
)
=
toJSON
$
base64
x
instance
IsString
JSONByteString
where
fromString
=
JSONByteString
.
fromString
-- | Store the value for a field, as an object parametrized by the Field. No verification is done
-- for these values.
...
...
@@ -850,7 +856,7 @@ setField :: (f ∈ WidgetFields w, IHaskellWidget (IPythonWidget w), ToPairs (At
=>
IPythonWidget
w
->
SField
f
->
FieldType
f
->
IO
()
setField
widget
sfield
fval
=
do
attr
<-
getAttr
widget
sfield
when
(
_ro
attr
)
$
error
(
"The field "
++
show
sfield
++
" is read only"
)
when
(
_ro
attr
)
$
error
(
"The field "
++
show
(
fromSing
sfield
)
++
" is read only"
)
!
newattr
<-
setField'
widget
sfield
fval
let
pairs
=
toPairs
newattr
unless
(
null
pairs
)
$
widgetSendUpdate
widget
(
object
pairs
)
...
...
Write
Preview
Markdown
is supported
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