Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
horizon-platform
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
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Théophile Choutri
horizon-platform
Commits
80c0a484
Commit
80c0a484
authored
2 years ago
by
Daniel Firth
Browse files
Options
Downloads
Patches
Plain Diff
ShellRC: add some lenses
parent
4869f565
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shell/ShellRC.hs
+62
-0
62 additions, 0 deletions
shell/ShellRC.hs
with
62 additions
and
0 deletions
shell/ShellRC.hs
+
62
−
0
View file @
80c0a484
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -Wno-missing-signatures #-}
{-# OPTIONS_GHC -Wno-missing-signatures #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
...
@@ -343,6 +345,66 @@ packagesBinding = makeBinding packagesIdentifier . packageListToExpr
...
@@ -343,6 +345,66 @@ packagesBinding = makeBinding packagesIdentifier . packageListToExpr
letPackagesBindingIn
::
PackageList
->
Expr
s
a
->
Expr
s
a
letPackagesBindingIn
::
PackageList
->
Expr
s
a
->
Expr
s
a
letPackagesBindingIn
xs
=
Let
(
packagesBinding
xs
)
letPackagesBindingIn
xs
=
Let
(
packagesBinding
xs
)
type
HasPackageSet
::
Type
->
Constraint
class
HasPackageSet
x
where
packageSetL
::
L
.
Lens'
x
PackageSet
instance
HasPackageSet
Overlay
where
packageSetL
=
L
.
lens
fromOverlay
(
\
(
MkOverlay
_
)
ys
->
MkOverlay
ys
)
instance
HasPackageSet
PackageSetExportSettings
where
packageSetL
=
L
.
lens
packageSet
(
\
x
y
->
x
{
packageSet
=
y
})
instance
HasPackageSet
OverlayExportSettings
where
packageSetL
=
L
.
lens
overlay
(
\
x
y
->
x
{
overlay
=
y
})
.
packageSetL
@
Overlay
instance
HasPackageSet
HorizonExport
where
packageSetL
f
=
\
case
MakePackageSet
x
->
MakePackageSet
<$>
packageSetL
f
x
MakeOverlay
x
->
MakeOverlay
<$>
packageSetL
f
x
type
HasPackages
::
Type
->
Constraint
class
HasPackages
x
where
packagesL
::
L
.
Lens'
x
PackageList
instance
HasPackages
PackageSet
where
packagesL
=
L
.
lens
packages
(
\
x
y
->
x
{
packages
=
y
})
instance
HasPackages
HorizonExport
where
packagesL
=
packageSetL
.
packagesL
@
PackageSet
type
instance
L
.
IxValue
PackageList
=
HaskellPackage
type
instance
L
.
Index
PackageList
=
Name
type
instance
L
.
IxValue
HorizonExport
=
HaskellPackage
type
instance
L
.
Index
HorizonExport
=
Name
instance
L
.
Ixed
PackageList
where
ix
k
f
(
MkPackageList
xs
)
=
MkPackageList
<$>
L
.
ix
k
f
xs
instance
L
.
At
PackageList
where
at
k
f
(
MkPackageList
xs
)
=
MkPackageList
<$>
L
.
at
k
f
xs
instance
L
.
Ixed
HorizonExport
where
ix
k
=
packagesL
@
HorizonExport
.
L
.
ix
@
PackageList
k
instance
L
.
At
HorizonExport
where
at
k
=
packagesL
@
HorizonExport
.
L
.
at
@
PackageList
k
deriving
newtype
instance
IsString
Name
deriving
newtype
instance
IsString
Version
defaultModifiers
::
Modifiers
defaultModifiers
=
MkModifiers
True
True
False
False
False
callHackage
::
Name
->
Version
->
HaskellPackage
callHackage
n
v
=
MkHaskellPackage
{
source
=
FromHackage
n
v
,
flags
=
[]
,
modifiers
=
defaultModifiers
}
go
::
IO
()
go
::
IO
()
go
=
do
go
=
do
x
<-
loadHorizon
x
<-
loadHorizon
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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