Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nofib
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
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
Sebastian Graf
nofib
Commits
5748d428
Commit
5748d428
authored
Sep 14, 2017
by
Joachim Breitner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fannkuch-redux: Implement Semigroup along with Monoid
so that it builds with GHC-8.3 post 8ae263c.
parent
999a46a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
shootout/fannkuch-redux/Main.hs
shootout/fannkuch-redux/Main.hs
+4
-2
No files found.
shootout/fannkuch-redux/Main.hs
View file @
5748d428
...
...
@@ -12,15 +12,17 @@ import Control.Concurrent
import
Control.Monad
import
System.Environment
import
Foreign
hiding
(
rotate
)
import
Data.
Monoid
import
Data.
Semigroup
type
Perm
=
Ptr
Word8
data
F
=
F
{-# UNPACK #-}
!
Int
{-# UNPACK #-}
!
Int
instance
Semigroup
F
where
F
s1
m1
<>
F
s2
m2
=
F
(
s1
+
s2
)
(
max
m1
m2
)
instance
Monoid
F
where
mempty
=
F
0
0
F
s1
m1
`
mappend
`
F
s2
m2
=
F
(
s1
+
s2
)
(
max
m1
m2
)
incPtr
=
(`
advancePtr
`
1
)
decPtr
=
(`
advancePtr
`
(
-
1
))
...
...
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