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
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
26e424d8
Commit
26e424d8
authored
Nov 15, 2018
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make member of Foldable class usable with unique states
parent
e444f984
Pipeline
#16470
passed with stage
in 2 minutes and 49 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
src/libraries/OS-Independent/Data/Foldable.dcl
src/libraries/OS-Independent/Data/Foldable.dcl
+4
-4
src/libraries/OS-Independent/Data/Monoid.dcl
src/libraries/OS-Independent/Data/Monoid.dcl
+4
-4
src/libraries/OS-Independent/Data/Monoid.icl
src/libraries/OS-Independent/Data/Monoid.icl
+4
-4
No files found.
src/libraries/OS-Independent/Data/Foldable.dcl
View file @
26e424d8
...
...
@@ -51,25 +51,25 @@ class Foldable t where
* Right-associative fold of a structure.
* `foldr f z = 'StdList'.{{foldr}} f z {{o}} {{toList}}`
*/
foldr
::
(
a
b
->
b
)
b
!(
t
a
)
->
b
foldr
::
(
a
.
b
->
.
b
)
.
b
!(
t
a
)
->
.
b
/**
* Right-associative fold of a structure, but with strict application of
* the operator.
*/
foldr`
::
(
a
b
->
b
)
!
b
!(
t
a
)
->
b
foldr`
::
(
a
.
b
->
.
b
)
!.
b
!(
t
a
)
->
.
b
/**
* Left-associative fold of a structure.
* `foldl f z = 'StdList'.{{foldl}} f z o {{toList}}`
*/
foldl
::
(
b
a
->
b
)
b
!(
t
a
)
->
b
foldl
::
(
.
b
->
.(
a
->
.
b
))
.
b
!(
t
a
)
->
.
b
/**
* Left-associative fold of a structure, but with strict application of the
* operator.
*/
foldl`
::
(
b
a
->
b
)
!
b
!(
t
a
)
->
b
foldl`
::
(
.
b
->
.(
a
->
.
b
))
!.
b
!(
t
a
)
->
.
b
/**
* A variant of {{foldr}} that has no base case, and thus may only be
...
...
src/libraries/OS-Independent/Data/Monoid.dcl
View file @
26e424d8
...
...
@@ -41,7 +41,7 @@ instance Monoid ()
::
Last
a
=
Last
(
Maybe
a
)
instance
Semigroup
(
Dual
a
)
|
Semigroup
a
instance
Semigroup
(
Endo
a
)
instance
Semigroup
(
Endo
.
a
)
instance
Semigroup
All
instance
Semigroup
Any
instance
Semigroup
(
Sum
a
)
|
+
a
&
zero
a
...
...
@@ -50,7 +50,7 @@ instance Semigroup (First a)
instance
Semigroup
(
Last
a
)
instance
Monoid
(
Dual
a
)
|
Monoid
a
instance
Monoid
(
Endo
a
)
instance
Monoid
(
Endo
.
a
)
instance
Monoid
All
instance
Monoid
Any
instance
Monoid
(
Sum
a
)
|
+
a
&
zero
a
...
...
@@ -58,9 +58,9 @@ instance Monoid (Product a) | * a & one a
instance
Monoid
(
First
a
)
instance
Monoid
(
Last
a
)
getDual
::
!(
Dual
a
)
->
a
getDual
::
!(
Dual
.
a
)
->
.
a
appEndo
::
!(
Endo
a
)
->
(
a
->
a
)
appEndo
::
!(
Endo
.
a
)
->
(.
a
->
.
a
)
getAll
::
!
All
->
Bool
...
...
src/libraries/OS-Independent/Data/Monoid.icl
View file @
26e424d8
...
...
@@ -18,10 +18,10 @@ instance Semigroup (Dual a) | Semigroup a where
instance
Monoid
(
Dual
a
)
|
Monoid
a
where
mempty
=
Dual
mempty
instance
Semigroup
(
Endo
a
)
where
instance
Semigroup
(
Endo
.
a
)
where
mappend
(
Endo
f
)
(
Endo
g
)
=
Endo
(
f
o
g
)
instance
Monoid
(
Endo
a
)
where
instance
Monoid
(
Endo
.
a
)
where
mempty
=
Endo
id
instance
Semigroup
All
where
...
...
@@ -62,10 +62,10 @@ instance Semigroup (Last a) where
instance
Monoid
(
Last
a
)
where
mempty
=
Last
Nothing
getDual
::
!(
Dual
a
)
->
a
getDual
::
!(
Dual
.
a
)
->
.
a
getDual
(
Dual
x
)
=
x
appEndo
::
!(
Endo
a
)
->
(
a
->
a
)
appEndo
::
!(
Endo
.
a
)
->
(.
a
->
.
a
)
appEndo
(
Endo
f
)
=
f
getAll
::
!
All
->
Bool
...
...
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