Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
outillage
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Show more breadcrumbs
Alice Brenon
outillage
Commits
c1195363
Commit
c1195363
authored
1 year ago
by
Alice Brenon
Browse files
Options
Downloads
Patches
Plain Diff
Follow type renaming in ghc-geode
parent
ada94702
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/merge.hs
+11
-11
11 additions, 11 deletions
scripts/merge.hs
scripts/select.hs
+2
-2
2 additions, 2 deletions
scripts/select.hs
with
13 additions
and
13 deletions
scripts/merge.hs
+
11
−
11
View file @
c1195363
...
...
@@ -6,42 +6,42 @@ import Data.Foldable (toList)
import
Data.Map
(
Map
,
(
!?
))
import
Data.Maybe
(
catMaybes
)
import
Data.Text
(
Text
,
pack
)
import
GEODE.Metadata
(
Contrastive
(
..
),
Entry
,
Has
(
..
),
MultiText
(
..
),
PrimaryKey
,
type
(
@
)(
..
),
indexBy
,
readNamedTsv
,
tsvFile
)
import
GEODE.Metadata
(
Contrastive
(
..
),
Entry
,
Has
(
..
),
MultiText
(
..
),
ArticleRecord
,
type
(
@
)(
..
),
indexBy
,
readNamedTsv
,
tsvFile
)
import
System.Environment
(
getArgs
)
import
System.Exit
(
die
)
import
System.Script
(
syntax
)
leftJoin
::
forall
a
b
c
t
.
(
Foldable
t
,
Functor
t
,
Has
PrimaryKey
a
,
Has
PrimaryKey
b
)
=>
leftJoin
::
forall
a
b
c
t
.
(
Foldable
t
,
Functor
t
,
Has
ArticleRecord
a
,
Has
ArticleRecord
b
)
=>
(
a
->
Maybe
b
->
c
)
->
t
a
->
t
b
->
t
c
leftJoin
f
left
right
=
outputRow
<$>
left
where
indexed
::
Map
PrimaryKey
b
indexed
::
Map
ArticleRecord
b
indexed
=
indexBy
get
right
outputRow
leftLine
=
f
leftLine
(
indexed
!?
get
leftLine
)
rightJoin
::
(
Foldable
t
,
Functor
t
,
Has
PrimaryKey
a
,
Has
PrimaryKey
b
)
=>
rightJoin
::
(
Foldable
t
,
Functor
t
,
Has
ArticleRecord
a
,
Has
ArticleRecord
b
)
=>
(
Maybe
a
->
b
->
c
)
->
t
a
->
t
b
->
t
c
rightJoin
f
left
right
=
leftJoin
(
flip
f
)
right
left
join
::
forall
a
b
c
t
.
(
Foldable
t
,
Functor
t
,
Has
PrimaryKey
a
,
Has
PrimaryKey
b
)
=>
join
::
forall
a
b
c
t
.
(
Foldable
t
,
Functor
t
,
Has
ArticleRecord
a
,
Has
ArticleRecord
b
)
=>
(
a
->
b
->
c
)
->
t
a
->
t
b
->
[
c
]
join
f
left
right
=
catMaybes
.
toList
$
outputRow
<$>
left
where
indexed
::
Map
PrimaryKey
b
indexed
::
Map
ArticleRecord
b
indexed
=
indexBy
get
right
outputRow
leftLine
=
f
leftLine
<$>
(
indexed
!?
get
leftLine
)
merge
::
(
PrimaryKey
@
Entry
)
->
(
PrimaryKey
@
Contrastive
)
->
(
PrimaryKey
@
Entry
@
Contrastive
)
merge
::
(
ArticleRecord
@
Entry
)
->
(
ArticleRecord
@
Contrastive
)
->
(
ArticleRecord
@
Entry
@
Contrastive
)
merge
(
pK
:@:
e
)
(
_
:@:
c
)
=
pK
:@:
e
:@:
c
tag
::
Text
->
Maybe
PrimaryKey
->
(
PrimaryKey
@
Entry
@
Contrastive
)
->
(
PrimaryKey
@
Entry
@
Contrastive
)
tag
::
Text
->
Maybe
ArticleRecord
->
(
ArticleRecord
@
Entry
@
Contrastive
)
->
(
ArticleRecord
@
Entry
@
Contrastive
)
tag
_
Nothing
l
=
l
tag
name
(
Just
_
)
(
pK
:@:
e
:@:
contr
)
=
pK
:@:
e
:@:
contr
{
subCorpus
=
MultiText
(
name
:
subCorpora
)
}
tag
name
(
Just
_
)
(
pK
:@:
e
:@:
contr
astive
)
=
pK
:@:
e
:@:
contr
astive
{
subCorpus
=
MultiText
(
name
:
subCorpora
)
}
where
MultiText
subCorpora
=
subCorpus
contr
MultiText
subCorpora
=
subCorpus
contr
astive
main
::
IO
()
main
=
getArgs
>>=
run
...
...
This diff is collapsed.
Click to expand it.
scripts/select.hs
+
2
−
2
View file @
c1195363
...
...
@@ -6,12 +6,12 @@ import Control.Monad.Except (ExceptT(..), runExceptT)
import
Data.Map
((
!?
))
import
Data.Maybe
(
catMaybes
)
import
Data.Vector
(
Vector
,
toList
)
import
GEODE.Metadata
(
Entry
,
Has
(
..
),
PrimaryKey
,
type
(
@
),
indexBy
,
readNamedTsv
,
tsvFile
)
import
GEODE.Metadata
(
Entry
,
Has
(
..
),
ArticleRecord
,
type
(
@
),
indexBy
,
readNamedTsv
,
tsvFile
)
import
System.Environment
(
getArgs
)
import
System.Exit
(
die
)
import
System.Script
(
syntax
)
getMeta
::
Vector
PrimaryKey
->
Vector
(
PrimaryKey
@
Entry
)
->
[(
PrimaryKey
@
Entry
)]
getMeta
::
Vector
ArticleRecord
->
Vector
(
ArticleRecord
@
Entry
)
->
[(
ArticleRecord
@
Entry
)]
getMeta
coords
meta
=
catMaybes
((
indexed
!?
)
<$>
toList
coords
)
where
indexed
=
indexBy
get
meta
...
...
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