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
C
clean-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
clean-platform
Commits
6cc65fc3
Commit
6cc65fc3
authored
Oct 12, 2018
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gEq,JSON instance for MaybeError
parent
5685b476
Pipeline
#14954
passed with stage
in 1 minute and 9 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
src/libraries/OS-Independent/Data/Error.dcl
src/libraries/OS-Independent/Data/Error.dcl
+3
-0
src/libraries/OS-Independent/Data/Error.icl
src/libraries/OS-Independent/Data/Error.icl
+3
-1
src/libraries/OS-Independent/Data/Error/GenJSON.dcl
src/libraries/OS-Independent/Data/Error/GenJSON.dcl
+8
-0
src/libraries/OS-Independent/Data/Error/GenJSON.icl
src/libraries/OS-Independent/Data/Error/GenJSON.icl
+6
-0
No files found.
src/libraries/OS-Independent/Data/Error.dcl
View file @
6cc65fc3
...
...
@@ -4,6 +4,7 @@ from Data.Functor import class Functor
from
Control
.
Monad
import
class
Monad
from
Control
.
Applicative
import
class
Applicative
from
Data
.
Maybe
import
::
Maybe
from
Data
.
GenEq
import
generic
gEq
/**
* A type representing something that may have failed.
...
...
@@ -22,6 +23,8 @@ instance Functor (MaybeError a)
instance
Applicative
(
MaybeError
a
)
instance
Monad
(
MaybeError
a
)
derive
gEq
MaybeError
/**
* Return True when the argument is an Ok value and return False otherwise.
*/
...
...
src/libraries/OS-Independent/Data/Error.icl
View file @
6cc65fc3
implementation
module
Data
.
Error
import
StdMisc
import
Data
.
Functor
,
Data
.
Maybe
import
Data
.
Functor
,
Data
.
Maybe
,
Data
.
GenEq
import
Control
.
Monad
import
Control
.
Applicative
...
...
@@ -19,6 +19,8 @@ instance Monad (MaybeError e) where
bind
(
Error
l
)
_
=
Error
l
bind
(
Ok
r
)
k
=
k
r
derive
gEq
MaybeError
isOk
::
!(
MaybeError
a
b
)
->
Bool
isOk
(
Ok
_)
=
True
isOk
(
Error
_)
=
False
...
...
src/libraries/OS-Independent/Data/Error/GenJSON.dcl
0 → 100644
View file @
6cc65fc3
definition
module
Data
.
Error
.
GenJSON
from
Data
.
Error
import
::
MaybeError
from
Text
.
GenJSON
import
generic
JSONEncode
,
generic
JSONDecode
,
::
JSONNode
from
Data
.
Maybe
import
::
Maybe
derive
JSONEncode
MaybeError
derive
JSONDecode
MaybeError
src/libraries/OS-Independent/Data/Error/GenJSON.icl
0 → 100644
View file @
6cc65fc3
implementation
module
Data
.
Error
.
GenJSON
import
Data
.
Error
,
Text
.
GenJSON
derive
JSONEncode
MaybeError
derive
JSONDecode
MaybeError
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