Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
fc558d33
Commit
fc558d33
authored
Sep 13, 2017
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made basic examples compile with recent editor API changes & fixed some imports
parent
1cac8f21
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
14 deletions
+15
-14
Examples/BasicAPIExamples.icl
Examples/BasicAPIExamples.icl
+5
-5
Libraries/iTasks/Extensions/Currency.icl
Libraries/iTasks/Extensions/Currency.icl
+6
-6
Libraries/iTasks/WF/Combinators/Core.icl
Libraries/iTasks/WF/Combinators/Core.icl
+2
-1
Libraries/iTasks/WF/Combinators/Overloaded.icl
Libraries/iTasks/WF/Combinators/Overloaded.icl
+2
-2
No files found.
Examples/BasicAPIExamples.icl
View file @
fc558d33
...
...
@@ -204,11 +204,11 @@ viewStoredPersons = viewSharedInformation "These are the currently stored person
notes
::
Task
String
notes
=
withShared
""
(\
note
->
viewSharedInformation
"view on note"
[
ViewUsing
id
(
textView
'
DM
'.
newMap
)
]
note
(\
note
->
viewSharedInformation
"view on note"
[
ViewUsing
id
textView
]
note
-||-
updateSharedInformation
"edit shared note 1"
[
UpdateUsing
id
(
const
id
)
(
textArea
'
DM
'.
newMap
)
]
note
updateSharedInformation
"edit shared note 1"
[
UpdateUsing
id
(
const
id
)
textArea
]
note
-||-
updateSharedInformation
"edit shared note 2"
[
UpdateUsing
id
(
const
id
)
(
textArea
'
DM
'.
newMap
)
]
note
updateSharedInformation
"edit shared note 2"
[
UpdateUsing
id
(
const
id
)
textArea
]
note
)
linesPar
::
Task
(
Maybe
String
)
...
...
@@ -229,7 +229,7 @@ where
lineE
state
=
updateSharedInformation
(
"Lines"
,
"Edit lines"
)
[
listEditor
]
state
noteEditor
=
UpdateUsing
id
(
const
id
)
(
textArea
'
DM
'.
newMap
)
noteEditor
=
UpdateUsing
id
(
const
id
)
textArea
listEditor
=
UpdateAs
(
split
"
\n
"
)
(\_
l
->
join
"
\n
"
l
)
browseAndViewGoogleMap
::
Task
GoogleMap
...
...
@@ -486,7 +486,7 @@ editWithStatistics
editFile
::
String
(
Shared
String
)
(
SharedTaskList
())
->
Task
()
editFile
fileName
sharedFile
_
=
updateSharedInformation
(
"edit "
+++
fileName
)
[
UpdateUsing
id
(
const
id
)
(
textArea
'
DM
'.
newMap
)
]
sharedFile
=
updateSharedInformation
(
"edit "
+++
fileName
)
[
UpdateUsing
id
(
const
id
)
textArea
]
sharedFile
@!
()
showStatistics
sharedFile
_
=
noStat
<<@
InWindow
...
...
Libraries/iTasks/Extensions/Currency.icl
View file @
fc558d33
...
...
@@ -8,9 +8,9 @@ import qualified Data.Map as DM
gText
{|
EUR
|}
_
val
=
[
maybe
""
toString
val
]
gEditor
{|
EUR
|}
=
selectByMode
(
comapEditorValue
toString
(
textView
'
DM
'.
newMap
)
)
(
bijectEditorValue
(\(
EUR
v
)
->
toReal
v
/
100.0
)
(\
v
->
EUR
(
toInt
(
100.0
*
v
)))
(
withDynamicHintAttributes
"amount in EUR"
(
decimalField
'
DM
'.
newMap
)
))
(
bijectEditorValue
(\(
EUR
v
)
->
toReal
v
/
100.0
)
(\
v
->
EUR
(
toInt
(
100.0
*
v
)))
(
withDynamicHintAttributes
"amount in EUR"
(
decimalField
'
DM
'.
newMap
)
))
(
comapEditorValue
toString
textView
)
(
bijectEditorValue
(\(
EUR
v
)
->
toReal
v
/
100.0
)
(\
v
->
EUR
(
toInt
(
100.0
*
v
)))
(
withDynamicHintAttributes
"amount in EUR"
decimalField
))
(
bijectEditorValue
(\(
EUR
v
)
->
toReal
v
/
100.0
)
(\
v
->
EUR
(
toInt
(
100.0
*
v
)))
(
withDynamicHintAttributes
"amount in EUR"
decimalField
))
instance
toString
EUR
where
...
...
@@ -43,9 +43,9 @@ where
gText
{|
USD
|}
_
val
=
[
maybe
""
toString
val
]
gEditor
{|
USD
|}
=
selectByMode
(
comapEditorValue
toString
(
textView
'
DM
'.
newMap
)
)
(
bijectEditorValue
(\(
USD
v
)
->
toReal
v
/
100.0
)
(\
v
->
USD
(
toInt
(
100.0
*
v
)))
(
withDynamicHintAttributes
"amount in USD"
(
decimalField
'
DM
'.
newMap
)
))
(
bijectEditorValue
(\(
USD
v
)
->
toReal
v
/
100.0
)
(\
v
->
USD
(
toInt
(
100.0
*
v
)))
(
withDynamicHintAttributes
"amount in USD"
(
decimalField
'
DM
'.
newMap
)
))
(
comapEditorValue
toString
textView
)
(
bijectEditorValue
(\(
USD
v
)
->
toReal
v
/
100.0
)
(\
v
->
USD
(
toInt
(
100.0
*
v
)))
(
withDynamicHintAttributes
"amount in USD"
decimalField
))
(
bijectEditorValue
(\(
USD
v
)
->
toReal
v
/
100.0
)
(\
v
->
USD
(
toInt
(
100.0
*
v
)))
(
withDynamicHintAttributes
"amount in USD"
decimalField
))
instance
toString
USD
where
...
...
Libraries/iTasks/WF/Combinators/Core.icl
View file @
fc558d33
...
...
@@ -22,6 +22,7 @@ import qualified Data.Queue as DQ
import
Data
.
Maybe
,
Data
.
Either
,
Data
.
Error
import
Text
.
JSON
from
Data
.
Functor
import
<$>
derive
gEq
ParallelTaskChange
...
...
@@ -526,7 +527,7 @@ evalParallelTasks listId taskTrees event evalOpts conts completed [{ParallelTask
//Decode value value
#
mbValue
=
case
encValue
of
NoValue
=
Just
NoValue
Value
json
stable
=
fmap
(\
dec
->
Value
dec
stable
)
(
fromJSON
json
)
Value
json
stable
=
(\
dec
->
Value
dec
stable
)
<$>
fromJSON
json
//TODO: use global tasktime to be able to compare event times between instances
#
evalInfo
=
{
TaskEvalInfo
|
lastEvent
=
0
,
removedTasks
=[],
refreshSensitive
=
True
}
=
maybe
(
ExceptionResult
(
exception
"Could not decode task value of detached task"
))
...
...
Libraries/iTasks/WF/Combinators/Overloaded.icl
View file @
fc558d33
...
...
@@ -4,14 +4,14 @@ import iTasks.WF.Definition
import
iTasks
.
WF
.
Tasks
.
Core
import
iTasks
.
WF
.
Combinators
.
Core
import
iTasks
.
WF
.
Combinators
.
Common
import
Data
.
Maybe
,
Data
.
Either
,
Data
.
List
import
Data
.
Maybe
,
Data
.
Either
,
Data
.
List
,
Data
.
Functor
import
iTasks
.
Internal
.
Serialization
instance
Functor
Task
where
fmap
f
x
=
transform
(
fmap
f
)
x
instance
TApplicative
Task
where
(<#>)
tf
ta
=
tf
>>=
\
f
->
f
map
f
ta
(<#>)
tf
ta
=
tf
>>=
\
f
->
f
<$>
ta
return
x
=
treturn
x
instance
TMonad
Task
where
...
...
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