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
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
209b49f4
Commit
209b49f4
authored
Mar 27, 2020
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'generic-Integer' into 'master'
add generic instances for Integer See merge request
!313
parents
5021fdcc
c89a2e35
Pipeline
#40623
passed with stage
in 1 minute and 57 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
0 deletions
+40
-0
src/libraries/OS-Independent/Data/Integer.dcl
src/libraries/OS-Independent/Data/Integer.dcl
+7
-0
src/libraries/OS-Independent/Data/Integer.icl
src/libraries/OS-Independent/Data/Integer.icl
+13
-0
src/libraries/OS-Independent/Data/Integer/GenJSON.dcl
src/libraries/OS-Independent/Data/Integer/GenJSON.dcl
+8
-0
src/libraries/OS-Independent/Data/Integer/GenJSON.icl
src/libraries/OS-Independent/Data/Integer/GenJSON.icl
+11
-0
tests/linux64/test.icl
tests/linux64/test.icl
+1
-0
No files found.
src/libraries/OS-Independent/Data/Integer.dcl
View file @
209b49f4
...
...
@@ -4,6 +4,9 @@
definition
module
Data
.
Integer
import
StdOverloaded
from
Data
.
GenDefault
import
generic
gDefault
from
Data
.
GenEq
import
generic
gEq
from
Data
.
GenLexOrd
import
generic
gLexOrd
,
::
LexOrd
::
Integer
=
{
integer_s
::!
Int
,
integer_a
::!.{#
Int
}};
...
...
@@ -43,3 +46,7 @@ instance toInteger String
/*
integer_a_to_double :: !Int !{#Int} -> Real
*/
derive
gDefault
Integer
derive
gEq
Integer
derive
gLexOrd
Integer
src/libraries/OS-Independent/Data/Integer.icl
View file @
209b49f4
...
...
@@ -2,6 +2,10 @@ implementation module Data.Integer
import
StdEnv
import
Data
.
Integer
.
ToString
,
Data
.
Integer
.
ToInteger
,
Data
.
Integer
.
Add
,
Data
.
Integer
.
Mul
,
Data
.
Integer
.
Div
import
Data
.
GenDefault
import
Data
.
GenLexOrd
import
qualified
Data
.
GenLexOrd
import
Data
.
GenEq
instance
toChar
Integer
where
toChar
i
=
toChar
(
toInt
i
)
...
...
@@ -1127,3 +1131,12 @@ rest_all_zeros i a
= True
*/
gDefault
{|
Integer
|}
=
{
integer_s
=
0
,
integer_a
={}}
gEq
{|
Integer
|}
x
y
=
x
==
y
gLexOrd
{|
Integer
|}
x
y
|
x
==
y
=
'
Data
.
GenLexOrd
'.
EQ
|
x
<
y
=
'
Data
.
GenLexOrd
'.
LT
|
otherwise
=
'
Data
.
GenLexOrd
'.
GT
src/libraries/OS-Independent/Data/Integer/GenJSON.dcl
0 → 100644
View file @
209b49f4
definition
module
Data
.
Integer
.
GenJSON
from
StdMaybe
import
::
Maybe
from
Data
.
Integer
import
::
Integer
from
Text
.
GenJSON
import
generic
JSONEncode
,
generic
JSONDecode
,
::
JSONNode
derive
JSONEncode
Integer
derive
JSONDecode
Integer
src/libraries/OS-Independent/Data/Integer/GenJSON.icl
0 → 100644
View file @
209b49f4
implementation
module
Data
.
Integer
.
GenJSON
import
StdEnv
import
Data
.
Integer
,
Text
.
GenJSON
JSONEncode
{|
Integer
|}
_
i
=
[
JSONInt
i
.
integer_s
,
JSONArray
[
JSONInt
c
\\
c
<-:
i
.
integer_a
]]
JSONDecode
{|
Integer
|}
_
l
=:[
JSONInt
s
,
JSONArray
a
:
rest
]
|
not
(
all
(\
x
->
x
=:(
JSONInt
_))
a
)
=
(
Nothing
,
l
)
=
(
Just
{
integer_s
=
s
,
integer_a
={
c
\\
JSONInt
c
<-
a
}},
rest
)
JSONDecode
{|
Integer
|}
_
l
=
(
Nothing
,
l
)
tests/linux64/test.icl
View file @
209b49f4
...
...
@@ -116,6 +116,7 @@ import qualified Data.Int
import
qualified
Data
.
Integer
import
qualified
Data
.
Integer
.
Add
import
qualified
Data
.
Integer
.
Div
import
qualified
Data
.
Integer
.
GenJSON
import
qualified
Data
.
Integer
.
Mul
import
qualified
Data
.
Integer
.
ToInteger
import
qualified
Data
.
Integer
.
ToString
...
...
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