Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
binary
Commits
ad752b42
Commit
ad752b42
authored
4 years ago
by
Daniel Rogozin
Browse files
Options
Downloads
Patches
Plain Diff
the char kind related update (#11342)
parent
c85c4e44
Branches
wip/ghc-11342-type-level-chars
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Data/Binary/Class.hs
+10
-1
10 additions, 1 deletion
src/Data/Binary/Class.hs
with
10 additions
and
1 deletion
src/Data/Binary/Class.hs
+
10
−
1
View file @
ad752b42
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE PolyKinds #-}
#
endif
#
endif
#
if
MIN_VERSION_base
(
4
,
16
,
0
)
#
define
HAS_TYPELITS_CHAR
#
endif
#
if
MIN_VERSION_base
(
4
,
8
,
0
)
#
if
MIN_VERSION_base
(
4
,
8
,
0
)
#
define
HAS_NATURAL
#
define
HAS_NATURAL
#
define
HAS_VOID
#
define
HAS_VOID
...
@@ -960,11 +964,17 @@ instance Binary KindRep where
...
@@ -960,11 +964,17 @@ instance Binary KindRep where
instance
Binary
TypeLitSort
where
instance
Binary
TypeLitSort
where
put
TypeLitSymbol
=
putWord8
0
put
TypeLitSymbol
=
putWord8
0
put
TypeLitNat
=
putWord8
1
put
TypeLitNat
=
putWord8
1
#
ifdef
HAS_TYPELITS_CHAR
put
TypeLitChar
=
putWord8
2
#
endif
get
=
do
get
=
do
tag
<-
getWord8
tag
<-
getWord8
case
tag
of
case
tag
of
0
->
pure
TypeLitSymbol
0
->
pure
TypeLitSymbol
1
->
pure
TypeLitNat
1
->
pure
TypeLitNat
#
ifdef
HAS_TYPELITS_CHAR
2
->
pure
TypeLitChar
#
endif
_
->
fail
"GHCi.TH.Binary.putTypeLitSort: invalid tag"
_
->
fail
"GHCi.TH.Binary.putTypeLitSort: invalid tag"
putTypeRep
::
TypeRep
a
->
Put
putTypeRep
::
TypeRep
a
->
Put
...
@@ -1044,4 +1054,3 @@ instance Binary SomeTypeRep where
...
@@ -1044,4 +1054,3 @@ instance Binary SomeTypeRep where
put
(
SomeTypeRep
rep
)
=
putTypeRep
rep
put
(
SomeTypeRep
rep
)
=
putTypeRep
rep
get
=
getSomeTypeRep
get
=
getSomeTypeRep
#
endif
#
endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment