Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
H
hoopl
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
Glasgow Haskell Compiler
Packages
hoopl
Commits
dccbc3aa
Commit
dccbc3aa
authored
Mar 28, 2016
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Functor, Foldable, Traversable instances for LabelMap
parent
b4477e82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
src/Compiler/Hoopl/Label.hs
src/Compiler/Hoopl/Label.hs
+7
-1
src/Compiler/Hoopl/Unique.hs
src/Compiler/Hoopl/Unique.hs
+7
-1
No files found.
src/Compiler/Hoopl/Label.hs
View file @
dccbc3aa
{-# LANGUAGE CPP, TypeFamilies #-}
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
#
if
__GLASGOW_HASKELL__
>=
701
{-# LANGUAGE Safe #-}
#
endif
...
...
@@ -17,6 +18,10 @@ where
import
Compiler.Hoopl.Collections
import
Compiler.Hoopl.Unique
#
if
!
MIN_VERSION_base
(
4
,
8
,
0
)
import
Data.Traversable
(
Traversable
)
import
Data.Foldable
(
Foldable
)
#
endif
-----------------------------------------------------------------------------
-- Label
...
...
@@ -64,7 +69,8 @@ instance IsSet LabelSet where
-----------------------------------------------------------------------------
-- LabelMap
newtype
LabelMap
v
=
LM
(
UniqueMap
v
)
deriving
(
Eq
,
Ord
,
Show
)
newtype
LabelMap
v
=
LM
(
UniqueMap
v
)
deriving
(
Eq
,
Ord
,
Show
,
Functor
,
Foldable
,
Traversable
)
instance
IsMap
LabelMap
where
type
KeyOf
LabelMap
=
Label
...
...
src/Compiler/Hoopl/Unique.hs
View file @
dccbc3aa
{-# LANGUAGE CPP, TypeFamilies #-}
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
#
if
__GLASGOW_HASKELL__
>=
709
{-# LANGUAGE Safe #-}
#
elif
__GLASGOW_HASKELL__
>=
701
...
...
@@ -26,6 +27,10 @@ import qualified Data.IntSet as S
import
Control.Applicative
as
AP
import
Control.Monad
(
ap
,
liftM
)
#
if
!
MIN_VERSION_base
(
4
,
8
,
0
)
import
Data.Traversable
(
Traversable
)
import
Data.Foldable
(
Foldable
)
#
endif
-----------------------------------------------------------------------------
-- Unique
...
...
@@ -69,7 +74,8 @@ instance IsSet UniqueSet where
-----------------------------------------------------------------------------
-- UniqueMap
newtype
UniqueMap
v
=
UM
(
M
.
IntMap
v
)
deriving
(
Eq
,
Ord
,
Show
)
newtype
UniqueMap
v
=
UM
(
M
.
IntMap
v
)
deriving
(
Eq
,
Ord
,
Show
,
Functor
,
Foldable
,
Traversable
)
instance
IsMap
UniqueMap
where
type
KeyOf
UniqueMap
=
Unique
...
...
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