Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gbs-downloader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
PrivateStorage
gbs-downloader
Commits
626a02d4
Commit
626a02d4
authored
1 year ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
LambdaCase, why not
parent
9484710e
No related branches found
No related tags found
1 merge request
!15
Use ExceptT
Pipeline
#5555
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
download-sdmf/Main.hs
+7
-6
7 additions, 6 deletions
download-sdmf/Main.hs
with
7 additions
and
6 deletions
download-sdmf/Main.hs
+
7
−
6
View file @
626a02d4
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
module
Main
where
...
...
@@ -23,16 +24,16 @@ main =
=<<
(
runExceptT
$
do
[
announcementPath
,
readCap
]
<-
lift
getArgs
-- Parse read capability
cap
<-
mightFail
"Failed to parse capability: "
.
pure
.
parse
pCapability
"<argv>"
.
T
.
pack
$
readCap
-- Load server announcements
announcements
<-
mightFail
"Failed to parse announcements: "
$
decodeFileEither
announcementPath
case
cap
of
(
SDMFVerifier
_
)
->
ExceptT
.
pure
.
Left
.
Failed
$
"Nothing implemented for verifier capabilities."
(
SDMFWriter
rwcap
)
->
go
announcements
(
writerReader
rwcap
)
(
SDMFReader
rocap
)
->
go
announcements
rocap
-- Parse read capability
(
mightFail
"Failed to parse capability: "
.
pure
.
parse
pCapability
"<argv>"
.
T
.
pack
)
readCap
>>=
\
case
SDMFVerifier
_
->
ExceptT
.
pure
.
Left
.
Failed
$
"Nothing implemented for verifier capabilities."
SDMFWriter
rwcap
->
go
announcements
(
writerReader
rwcap
)
SDMFReader
rocap
->
go
announcements
rocap
)
where
go
::
Announcements
->
Reader
->
ExceptT
Failed
IO
BL
.
ByteString
...
...
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