Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Rinat Striungis
binary
Commits
fe6c2133
Commit
fe6c2133
authored
18 years ago
by
Don Stewart
Browse files
Options
Downloads
Patches
Plain Diff
PutM is a better name than Put_
parent
f495792d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Data/Binary/Put.hs
+8
-4
8 additions, 4 deletions
src/Data/Binary/Put.hs
with
8 additions
and
4 deletions
src/Data/Binary/Put.hs
+
8
−
4
View file @
fe6c2133
...
...
@@ -49,14 +49,14 @@ import qualified Data.ByteString.Lazy as L
-- | The Put types. A Writer monad over the efficient Builder monoid.
-- Put merely lifts Builder into a monad
newtype
Put
_
a
=
Put
{
unPut
::
(
a
,
Builder
)
}
type
Put
=
Put
_
()
newtype
Put
M
a
=
Put
{
unPut
::
(
a
,
Builder
)
}
type
Put
=
Put
M
()
instance
Functor
Put
_
where
instance
Functor
Put
M
where
fmap
f
m
=
Put
(
let
(
a
,
w
)
=
unPut
m
in
(
f
a
,
w
))
instance
Monad
Put
_
where
instance
Monad
Put
M
where
return
a
=
Put
(
a
,
B
.
empty
)
m
>>=
k
=
Put
(
let
(
a
,
w
)
=
unPut
m
...
...
@@ -108,15 +108,19 @@ putWord16le = tell . B.putWord16le
-- | Write a Word32 in big endian format
putWord32be
::
Word32
->
Put
putWord32be
=
tell
.
B
.
putWord32be
{-# INLINE putWord32be #-}
-- | Write a Word32 in little endian format
putWord32le
::
Word32
->
Put
putWord32le
=
tell
.
B
.
putWord32le
{-# INLINE putWord32le #-}
-- | Write a Word64 in big endian format
putWord64be
::
Word64
->
Put
putWord64be
=
tell
.
B
.
putWord64be
{-# INLINE putWord64be #-}
-- | Write a Word64 in little endian format
putWord64le
::
Word64
->
Put
putWord64le
=
tell
.
B
.
putWord64le
{-# INLINE putWord64le #-}
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