Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
73
Issues
73
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
15148e73
Commit
15148e73
authored
May 17, 2019
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix implementation of ==
parent
3e2fb579
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
Examples/DynamicEditor/DynEditorExample.icl
Examples/DynamicEditor/DynEditorExample.icl
+4
-8
No files found.
Examples/DynamicEditor/DynEditorExample.icl
View file @
15148e73
module
DynEditorExample
import
StdEnv
import
Data
.
Func
import
iTasks
,
iTasks
.
Extensions
.
Editors
.
DynamicEditor
...
...
@@ -8,12 +9,7 @@ Start world = doTasks editTask world
editTask
=
enterInformation
()
[
EnterUsing
id
$
dynamicEditor
taskEditor
]
>>=
\
expr
->
case
evalExpr
$
toValue
taskEditor
expr
of
Val
value
=
viewInformation
()
[]
value
@!
()
/*enterTask =
enterInformation () [EnterUsing id $ dynamicEditor tEditor] ^&>
viewSharedInformation () [ViewAs $ fmap $ toValue tEditor] >>= \taskExpr ->
interpret (toValue tEditor te) >>= viewInformation "result = " [] */
Val
value
=
viewInformation
()
[]
value
@!
()
::
TaskExpr
=
ViewInformation
|
Apply
TaskExpr
Expr
::
Expr
=
Int
Int
|
Bool
Bool
|
Tuple
Expr
Expr
|
Fst
Expr
|
Snd
Expr
|
Eq
Expr
Expr
...
...
@@ -48,7 +44,7 @@ where
(
dynamic
\(
Typed
(
Tuple
_
b
))
->
Typed
b
::
A
.
a
b
:
(
Typed
Expr
(
a
,
b
))
->
Typed
Expr
b
)
,
functionConsDyn
"=="
"=="
(
dynamic
\(
Typed
a
)
(
Typed
b
)
->
Typed
(
Eq
a
b
)
::
A
.
a
b
:
(
Typed
Expr
a
)
(
Typed
Expr
b
)
->
Typed
Expr
Bool
A
.
a
:
(
Typed
Expr
a
)
(
Typed
Expr
a
)
->
Typed
Expr
Bool
)
,
customEditorCons
"Int"
"(enter integer)"
intEditor
<<@@@
HideIfOnlyChoice
,
customEditorCons
"Bool"
"(enter boolean)"
boolEditor
<<@@@
HideIfOnlyChoice
...
...
@@ -70,7 +66,7 @@ evalExpr (Bool b) = Val b
evalExpr
(
Tuple
fstExpr
sndExpr
)
=
case
(
evalExpr
fstExpr
,
evalExpr
sndExpr
)
of
(
Val
fstVal
,
Val
sndVal
)
=
Val
(
fstVal
,
sndVal
)
evalExpr
(
Eq
expr1
expr2
)
=
case
(
evalExpr
expr1
,
evalExpr
expr2
)
of
(
Val
value1
,
Val
value2
)
=
case
dynamic
(
value1
,
value2
)
of
(
Val
value1
,
Val
value2
)
=
case
dynamic
(
(===)
value1
,
value2
)
of
((
equalsValue1
,
value2
)
::
(
a
->
Bool
,
a
))
=
Val
$
equalsValue1
value2
/*
...
...
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