{-# LANGUAGE UndecidableInstances #-}
module Nix.Match
( match
, findMatches
, Matchable(..)
, GMatchable(..)
, WithHoles(..)
, addHoles
, addHolesLoc
, isOptionalPath
) where
import Control.Category ( (>>>) )
import Control.Monad ( void )
import Data.Data
import Data.Fix
import Data.Foldable
import Data.List.NonEmpty ( NonEmpty )
import Data.Maybe
import Data.Monoid hiding ( All )
import Data.Text ( Text )
import qualified Data.Text as T
import GHC.Base ( NonEmpty((:|)) )
import GHC.Generics
import Nix
data WithHoles t v
= Hole !v
| Term !(t (WithHoles t v))
deriving instance (Typeable t, Data (t (WithHoles t v)), Data v) => Data (WithHoles t v)
match :: Matchable t => WithHoles t v -> Fix t -> Maybe [(v, Fix t)]
match :: WithHoles t v -> Fix t -> Maybe [(v, Fix t)]
match = (Endo [(v, Fix t)] -> [(v, Fix t)])
-> Maybe (Endo [(v, Fix t)]) -> Maybe [(v, Fix t)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Endo [(v, Fix t)] -> [(v, Fix t)] -> [(v, Fix t)]
forall a. Endo a -> a -> a
`appEndo` []) (Maybe (Endo [(v, Fix t)]) -> Maybe [(v, Fix t)])
-> (WithHoles t v -> Fix t -> Maybe (Endo [(v, Fix t)]))
-> WithHoles t v
-> Fix t
-> Maybe [(v, Fix t)]
forall b c a1 a2. (b -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c
.: WithHoles t v -> Fix t -> Maybe (Endo [(v, Fix t)])
forall a. WithHoles t a -> Fix t -> Maybe (Endo [(a, Fix t)])
go
where
go :: WithHoles t a -> Fix t -> Maybe (Endo [(a, Fix t)])
go = \case
Hole a
v -> \Fix t
t -> Endo [(a, Fix t)] -> Maybe (Endo [(a, Fix t)])
forall a. a -> Maybe a
Just (([(a, Fix t)] -> [(a, Fix t)]) -> Endo [(a, Fix t)]
forall a. (a -> a) -> Endo a
Endo ((a
v, Fix t
t) (a, Fix t) -> [(a, Fix t)] -> [(a, Fix t)]
forall a. a -> [a] -> [a]
:))
Term t (WithHoles t a)
s -> \(Fix t (Fix t)
t) -> do
t (WithHoles t a, Fix t)
m <- t (WithHoles t a) -> t (Fix t) -> Maybe (t (WithHoles t a, Fix t))
forall (t :: * -> *) a b.
Matchable t =>
t a -> t b -> Maybe (t (a, b))
zipMatchLeft t (WithHoles t a)
s t (Fix t)
t
([Endo [(a, Fix t)]] -> Endo [(a, Fix t)])
-> Maybe [Endo [(a, Fix t)]] -> Maybe (Endo [(a, Fix t)])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap [Endo [(a, Fix t)]] -> Endo [(a, Fix t)]
forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m
fold (Maybe [Endo [(a, Fix t)]] -> Maybe (Endo [(a, Fix t)]))
-> (t (WithHoles t a, Fix t) -> Maybe [Endo [(a, Fix t)]])
-> t (WithHoles t a, Fix t)
-> Maybe (Endo [(a, Fix t)])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((WithHoles t a, Fix t) -> Maybe (Endo [(a, Fix t)]))
-> [(WithHoles t a, Fix t)] -> Maybe [Endo [(a, Fix t)]]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((WithHoles t a -> Fix t -> Maybe (Endo [(a, Fix t)]))
-> (WithHoles t a, Fix t) -> Maybe (Endo [(a, Fix t)])
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry WithHoles t a -> Fix t -> Maybe (Endo [(a, Fix t)])
go) ([(WithHoles t a, Fix t)] -> Maybe [Endo [(a, Fix t)]])
-> (t (WithHoles t a, Fix t) -> [(WithHoles t a, Fix t)])
-> t (WithHoles t a, Fix t)
-> Maybe [Endo [(a, Fix t)]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t (WithHoles t a, Fix t) -> [(WithHoles t a, Fix t)]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList (t (WithHoles t a, Fix t) -> Maybe (Endo [(a, Fix t)]))
-> t (WithHoles t a, Fix t) -> Maybe (Endo [(a, Fix t)])
forall a b. (a -> b) -> a -> b
$ t (WithHoles t a, Fix t)
m
findMatches
:: Matchable t
=> WithHoles t v
-> Fix t
-> [(Fix t, [(v, Fix t)])]
findMatches :: WithHoles t v -> Fix t -> [(Fix t, [(v, Fix t)])]
findMatches WithHoles t v
needle Fix t
haystack =
[ (Fix t
s, [(v, Fix t)]
r) | Fix t
s <- Fix t -> [Fix t]
forall (f :: * -> *). Foldable f => Fix f -> [Fix f]
fixUniverse Fix t
haystack, Just [(v, Fix t)]
r <- Maybe [(v, Fix t)] -> [Maybe [(v, Fix t)]]
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe [(v, Fix t)] -> [Maybe [(v, Fix t)]])
-> Maybe [(v, Fix t)] -> [Maybe [(v, Fix t)]]
forall a b. (a -> b) -> a -> b
$ WithHoles t v -> Fix t -> Maybe [(v, Fix t)]
forall (t :: * -> *) v.
Matchable t =>
WithHoles t v -> Fix t -> Maybe [(v, Fix t)]
match WithHoles t v
needle Fix t
s ]
fixUniverse :: Foldable f => Fix f -> [Fix f]
fixUniverse :: Fix f -> [Fix f]
fixUniverse Fix f
e = Fix f
e Fix f -> [Fix f] -> [Fix f]
forall a. a -> [a] -> [a]
: (Fix f -> [Fix f]
forall (f :: * -> *). Foldable f => Fix f -> [Fix f]
fixUniverse (Fix f -> [Fix f]) -> [Fix f] -> [Fix f]
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< f (Fix f) -> [Fix f]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList (Fix f -> f (Fix f)
forall (f :: * -> *). Fix f -> f (Fix f)
unFix Fix f
e))
addHoles :: NExpr -> WithHoles NExprF Text
addHoles :: NExpr -> WithHoles NExprF Text
addHoles = NExpr -> NExprF NExpr
forall (f :: * -> *). Fix f -> f (Fix f)
unFix (NExpr -> NExprF NExpr)
-> (NExprF NExpr -> WithHoles NExprF Text)
-> NExpr
-> WithHoles NExprF Text
forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k).
Category cat =>
cat a b -> cat b c -> cat a c
>>> \case
NSynHole Text
n -> Text -> WithHoles NExprF Text
forall (t :: * -> *) v. v -> WithHoles t v
Hole Text
n
NExprF NExpr
e -> NExprF (WithHoles NExprF Text) -> WithHoles NExprF Text
forall (t :: * -> *) v. t (WithHoles t v) -> WithHoles t v
Term (NExprF (WithHoles NExprF Text) -> WithHoles NExprF Text)
-> (NExprF NExpr -> NExprF (WithHoles NExprF Text))
-> NExprF NExpr
-> WithHoles NExprF Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NExpr -> WithHoles NExprF Text)
-> NExprF NExpr -> NExprF (WithHoles NExprF Text)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NExpr -> WithHoles NExprF Text
addHoles (NExprF NExpr -> WithHoles NExprF Text)
-> NExprF NExpr -> WithHoles NExprF Text
forall a b. (a -> b) -> a -> b
$ NExprF NExpr
e
addHolesLoc :: NExprLoc -> WithHoles NExprLocF Text
addHolesLoc :: NExprLoc -> WithHoles NExprLocF Text
addHolesLoc = NExprLoc -> NExprLocF NExprLoc
forall (f :: * -> *). Fix f -> f (Fix f)
unFix (NExprLoc -> NExprLocF NExprLoc)
-> (NExprLocF NExprLoc -> WithHoles NExprLocF Text)
-> NExprLoc
-> WithHoles NExprLocF Text
forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k).
Category cat =>
cat a b -> cat b c -> cat a c
>>> \case
Compose (Ann SrcSpan
_ (NSynHole Text
n)) -> Text -> WithHoles NExprLocF Text
forall (t :: * -> *) v. v -> WithHoles t v
Hole Text
n
NExprLocF NExprLoc
e -> NExprLocF (WithHoles NExprLocF Text) -> WithHoles NExprLocF Text
forall (t :: * -> *) v. t (WithHoles t v) -> WithHoles t v
Term (NExprLocF (WithHoles NExprLocF Text) -> WithHoles NExprLocF Text)
-> (NExprLocF NExprLoc -> NExprLocF (WithHoles NExprLocF Text))
-> NExprLocF NExprLoc
-> WithHoles NExprLocF Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NExprLoc -> WithHoles NExprLocF Text)
-> NExprLocF NExprLoc -> NExprLocF (WithHoles NExprLocF Text)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NExprLoc -> WithHoles NExprLocF Text
addHolesLoc (NExprLocF NExprLoc -> WithHoles NExprLocF Text)
-> NExprLocF NExprLoc -> WithHoles NExprLocF Text
forall a b. (a -> b) -> a -> b
$ NExprLocF NExprLoc
e
class Traversable t => Matchable t where
zipMatchLeft :: t a -> t b -> Maybe (t (a,b))
default zipMatchLeft
:: (Generic1 t, GMatchable (Rep1 t))
=> t a
-> t b
-> Maybe (t (a, b))
zipMatchLeft t a
l t b
r = Rep1 t (a, b) -> t (a, b)
forall k (f :: k -> *) (a :: k). Generic1 f => Rep1 f a -> f a
to1 (Rep1 t (a, b) -> t (a, b))
-> Maybe (Rep1 t (a, b)) -> Maybe (t (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Rep1 t a -> Rep1 t b -> Maybe (Rep1 t (a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft (t a -> Rep1 t a
forall k (f :: k -> *) (a :: k). Generic1 f => f a -> Rep1 f a
from1 t a
l) (t b -> Rep1 t b
forall k (f :: k -> *) (a :: k). Generic1 f => f a -> Rep1 f a
from1 t b
r)
zipMatchLeft2
:: (Matchable f, Matchable t) => t (f a) -> t (f b) -> Maybe (t (f (a, b)))
zipMatchLeft2 :: t (f a) -> t (f b) -> Maybe (t (f (a, b)))
zipMatchLeft2 t (f a)
a t (f b)
b = t (f a) -> t (f b) -> Maybe (t (f a, f b))
forall (t :: * -> *) a b.
Matchable t =>
t a -> t b -> Maybe (t (a, b))
zipMatchLeft t (f a)
a t (f b)
b Maybe (t (f a, f b))
-> (t (f a, f b) -> Maybe (t (f (a, b)))) -> Maybe (t (f (a, b)))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ((f a, f b) -> Maybe (f (a, b)))
-> t (f a, f b) -> Maybe (t (f (a, b)))
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((f a -> f b -> Maybe (f (a, b))) -> (f a, f b) -> Maybe (f (a, b))
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry f a -> f b -> Maybe (f (a, b))
forall (t :: * -> *) a b.
Matchable t =>
t a -> t b -> Maybe (t (a, b))
zipMatchLeft)
instance Matchable NExprF where
zipMatchLeft :: NExprF a -> NExprF b -> Maybe (NExprF (a, b))
zipMatchLeft (NSet NRecordType
_ [Binding a]
bs1) (NSet NRecordType
_ [Binding b]
bs2) = do
([Binding a]
bs1', [Binding b]
bs2') <- [(Binding a, Binding b)] -> ([Binding a], [Binding b])
forall a b. [(a, b)] -> ([a], [b])
unzip ([(Binding a, Binding b)] -> ([Binding a], [Binding b]))
-> Maybe [(Binding a, Binding b)]
-> Maybe ([Binding a], [Binding b])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Binding a] -> [Binding b] -> Maybe [(Binding a, Binding b)]
forall q r.
[Binding q] -> [Binding r] -> Maybe [(Binding q, Binding r)]
reduceBindings [Binding a]
bs1 [Binding b]
bs2
D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
(a, b)
-> NExprF (a, b)
forall k (f :: k -> *) (a :: k). Generic1 f => Rep1 f a -> f a
to1 (D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
(a, b)
-> NExprF (a, b))
-> Maybe
(D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
(Rec0 Text)))))))
(a, b))
-> Maybe (NExprF (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> M1
D
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
a
-> M1
D
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
b
-> Maybe
(D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
(Rec0 Text)))))))
(a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft (NExprF a -> Rep1 NExprF a
forall k (f :: k -> *) (a :: k). Generic1 f => f a -> Rep1 f a
from1 (NRecordType -> [Binding a] -> NExprF a
forall r. NRecordType -> [Binding r] -> NExprF r
NSet NRecordType
NNonRecursive [Binding a]
bs1'))
(NExprF b -> Rep1 NExprF b
forall k (f :: k -> *) (a :: k). Generic1 f => f a -> Rep1 f a
from1 (NRecordType -> [Binding b] -> NExprF b
forall r. NRecordType -> [Binding r] -> NExprF r
NSet NRecordType
NNonRecursive [Binding b]
bs2'))
zipMatchLeft (NLet [Binding a]
bs1 a
e1) (NLet [Binding b]
bs2 b
e2) = do
([Binding a]
bs1', [Binding b]
bs2') <- [(Binding a, Binding b)] -> ([Binding a], [Binding b])
forall a b. [(a, b)] -> ([a], [b])
unzip ([(Binding a, Binding b)] -> ([Binding a], [Binding b]))
-> Maybe [(Binding a, Binding b)]
-> Maybe ([Binding a], [Binding b])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Binding a] -> [Binding b] -> Maybe [(Binding a, Binding b)]
forall q r.
[Binding q] -> [Binding r] -> Maybe [(Binding q, Binding r)]
reduceBindings [Binding a]
bs1 [Binding b]
bs2
D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
(a, b)
-> NExprF (a, b)
forall k (f :: k -> *) (a :: k). Generic1 f => Rep1 f a -> f a
to1 (D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
(a, b)
-> NExprF (a, b))
-> Maybe
(D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
(Rec0 Text)))))))
(a, b))
-> Maybe (NExprF (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> M1
D
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
a
-> M1
D
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
b
-> Maybe
(D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
(Rec0 Text)))))))
(a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft (NExprF a -> Rep1 NExprF a
forall k (f :: k -> *) (a :: k). Generic1 f => f a -> Rep1 f a
from1 ([Binding a] -> a -> NExprF a
forall r. [Binding r] -> r -> NExprF r
NLet [Binding a]
bs1' a
e1)) (NExprF b -> Rep1 NExprF b
forall k (f :: k -> *) (a :: k). Generic1 f => f a -> Rep1 f a
from1 ([Binding b] -> b -> NExprF b
forall r. [Binding r] -> r -> NExprF r
NLet [Binding b]
bs2' b
e2))
zipMatchLeft (NAbs (Param Text
"_") a
e1) (NAbs Params b
_ b
e2) = do
NExprF (a, b) -> Maybe (NExprF (a, b))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (NExprF (a, b) -> Maybe (NExprF (a, b)))
-> NExprF (a, b) -> Maybe (NExprF (a, b))
forall a b. (a -> b) -> a -> b
$ Params (a, b) -> (a, b) -> NExprF (a, b)
forall r. Params r -> r -> NExprF r
NAbs (Text -> Params (a, b)
forall r. Text -> Params r
Param Text
"_") (a
e1, b
e2)
zipMatchLeft NExprF a
l NExprF b
r = D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
(a, b)
-> NExprF (a, b)
forall k (f :: k -> *) (a :: k). Generic1 f => Rep1 f a -> f a
to1 (D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
(a, b)
-> NExprF (a, b))
-> Maybe
(D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
(Rec0 Text)))))))
(a, b))
-> Maybe (NExprF (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> M1
D
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
a
-> M1
D
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text)))))))
b
-> Maybe
(D1
('MetaData
"NExprF"
"Nix.Expr.Types"
"hnix-0.13.1-HF2FjFKX8aKAFvCx5N9VGI"
'False)
((((C1
('MetaCons "NConstant" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NAtom))
:+: C1
('MetaCons "NStr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 NString)))
:+: (C1
('MetaCons "NSym" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 Text))
:+: C1
('MetaCons "NList" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 []))))
:+: ((C1
('MetaCons "NSet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NRecordType)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding))
:+: C1
('MetaCons "NLiteralPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath)))
:+: (C1
('MetaCons "NEnvPath" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 FilePath))
:+: C1
('MetaCons "NUnary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NUnaryOp)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))))
:+: (((C1
('MetaCons "NBinary" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec0 NBinaryOp)
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1))
:+: C1
('MetaCons "NSelect" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Maybe))))
:+: (C1
('MetaCons "NHasAttr" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(NonEmpty :.: Rec1 NKeyName))
:+: C1
('MetaCons "NAbs" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
(Rec1 Params)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)))
:+: ((C1
('MetaCons "NLet" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
([] :.: Rec1 Binding)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: C1
('MetaCons "NIf" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: (S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)))
:+: (C1
('MetaCons "NWith" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1)
:+: (C1
('MetaCons "NAssert" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict)
Par1
:*: S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
Par1)
:+: C1
('MetaCons "NSynHole" 'PrefixI 'False)
(S1
('MetaSel
'Nothing
'NoSourceUnpackedness
'SourceStrict
'DecidedStrict)
(Rec0 Text)))))))
(a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft (NExprF a -> Rep1 NExprF a
forall k (f :: k -> *) (a :: k). Generic1 f => f a -> Rep1 f a
from1 NExprF a
l) (NExprF b -> Rep1 NExprF b
forall k (f :: k -> *) (a :: k). Generic1 f => f a -> Rep1 f a
from1 NExprF b
r)
reduceBindings :: [Binding q] -> [Binding r] -> Maybe [(Binding q, Binding r)]
reduceBindings :: [Binding q] -> [Binding r] -> Maybe [(Binding q, Binding r)]
reduceBindings [Binding q]
needle [Binding r]
matchee =
let
isOptional :: Binding r -> Maybe (Binding r)
isOptional = \case
NamedVar NAttrPath r
p r
e SourcePos
l | Just NAttrPath r
p' <- NAttrPath r -> Maybe (NAttrPath r)
forall r. NAttrPath r -> Maybe (NAttrPath r)
isOptionalPath NAttrPath r
p -> Binding r -> Maybe (Binding r)
forall a. a -> Maybe a
Just (NAttrPath r -> r -> SourcePos -> Binding r
forall r. NAttrPath r -> r -> SourcePos -> Binding r
NamedVar NAttrPath r
p' r
e SourcePos
l)
Binding r
_ -> Maybe (Binding r)
forall a. Maybe a
Nothing
getLHS :: Binding a
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
getLHS = \case
NamedVar NAttrPath a
p a
_ SourcePos
_ -> NonEmpty (NKeyName ())
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
forall a b. a -> Either a b
Left ((NKeyName a -> NKeyName ())
-> NAttrPath a -> NonEmpty (NKeyName ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NKeyName a -> NKeyName ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void NAttrPath a
p)
Inherit Maybe a
r [NKeyName a]
ps SourcePos
_ -> (Maybe (), [NKeyName ()])
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
forall a b. b -> Either a b
Right (Maybe a -> Maybe ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void Maybe a
r, (NKeyName a -> NKeyName ()) -> [NKeyName a] -> [NKeyName ()]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NKeyName a -> NKeyName ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void [NKeyName a]
ps)
in [Maybe (Binding q, Binding r)] -> Maybe [(Binding q, Binding r)]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence
[ (Binding q
n', ) (Binding r -> (Binding q, Binding r))
-> Maybe (Binding r) -> Maybe (Binding q, Binding r)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Binding r)
m
|
Binding q
n <- [Binding q]
needle
, let opt :: Maybe (Binding q)
opt = Binding q -> Maybe (Binding q)
forall r. Binding r -> Maybe (Binding r)
isOptional Binding q
n
n' :: Binding q
n' = Binding q -> Maybe (Binding q) -> Binding q
forall a. a -> Maybe a -> a
fromMaybe Binding q
n Maybe (Binding q)
opt
lhs :: Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
lhs = Binding q
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
forall a.
Binding a
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
getLHS Binding q
n'
m :: Maybe (Binding r)
m = (Binding r -> Bool) -> [Binding r] -> Maybe (Binding r)
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
lhs Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
-> Bool
forall a. Eq a => a -> a -> Bool
==) (Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()]) -> Bool)
-> (Binding r
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()]))
-> Binding r
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Binding r
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
forall a.
Binding a
-> Either (NonEmpty (NKeyName ())) (Maybe (), [NKeyName ()])
getLHS) [Binding r]
matchee
,
Maybe (Binding q) -> Bool
forall a. Maybe a -> Bool
isNothing Maybe (Binding q)
opt Bool -> Bool -> Bool
|| Maybe (Binding r) -> Bool
forall a. Maybe a -> Bool
isJust Maybe (Binding r)
m
]
isOptionalPath :: NAttrPath r -> Maybe (NAttrPath r)
isOptionalPath :: NAttrPath r -> Maybe (NAttrPath r)
isOptionalPath = \case
StaticKey Text
n :| [] | Just (Char
'_', Text
t) <- Text -> Maybe (Char, Text)
T.uncons Text
n -> NAttrPath r -> Maybe (NAttrPath r)
forall a. a -> Maybe a
Just (Text -> NKeyName r
forall r. Text -> NKeyName r
StaticKey Text
t NKeyName r -> [NKeyName r] -> NAttrPath r
forall a. a -> [a] -> NonEmpty a
:| [])
DynamicKey (Plain (DoubleQuoted [Plain Text
n])) :| [NKeyName r]
rs
| Just (Char
'_', Text
t) <- Text -> Maybe (Char, Text)
T.uncons Text
n -> NAttrPath r -> Maybe (NAttrPath r)
forall a. a -> Maybe a
Just
(Antiquoted (NString r) r -> NKeyName r
forall r. Antiquoted (NString r) r -> NKeyName r
DynamicKey (NString r -> Antiquoted (NString r) r
forall v r. v -> Antiquoted v r
Plain ([Antiquoted Text r] -> NString r
forall r. [Antiquoted Text r] -> NString r
DoubleQuoted [Text -> Antiquoted Text r
forall v r. v -> Antiquoted v r
Plain Text
t])) NKeyName r -> [NKeyName r] -> NAttrPath r
forall a. a -> [a] -> NonEmpty a
:| [NKeyName r]
rs)
NAttrPath r
_ -> Maybe (NAttrPath r)
forall a. Maybe a
Nothing
instance Matchable NString where
instance Matchable (Antiquoted Text) where
instance Matchable Binding where
zipMatchLeft :: Binding a -> Binding b -> Maybe (Binding (a, b))
zipMatchLeft (NamedVar NAttrPath a
p1 a
v1 SourcePos
_) (NamedVar NAttrPath b
p2 b
v2 SourcePos
l) = do
NonEmpty (NKeyName (a, b))
p <- NAttrPath a -> NAttrPath b -> Maybe (NonEmpty (NKeyName (a, b)))
forall (f :: * -> *) (t :: * -> *) a b.
(Matchable f, Matchable t) =>
t (f a) -> t (f b) -> Maybe (t (f (a, b)))
zipMatchLeft2 NAttrPath a
p1 NAttrPath b
p2
Binding (a, b) -> Maybe (Binding (a, b))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (NonEmpty (NKeyName (a, b)) -> (a, b) -> SourcePos -> Binding (a, b)
forall r. NAttrPath r -> r -> SourcePos -> Binding r
NamedVar NonEmpty (NKeyName (a, b))
p (a
v1, b
v2) SourcePos
l)
zipMatchLeft (Inherit Maybe a
x1 [NKeyName a]
ys1 SourcePos
l) (Inherit Maybe b
x2 [NKeyName b]
ys2 SourcePos
_) = do
Maybe (a, b)
x <- Maybe a -> Maybe b -> Maybe (Maybe (a, b))
forall (t :: * -> *) a b.
Matchable t =>
t a -> t b -> Maybe (t (a, b))
zipMatchLeft Maybe a
x1 Maybe b
x2
[NKeyName (a, b)]
ys <- [NKeyName a] -> [NKeyName b] -> Maybe [NKeyName (a, b)]
forall (f :: * -> *) (t :: * -> *) a b.
(Matchable f, Matchable t) =>
t (f a) -> t (f b) -> Maybe (t (f (a, b)))
zipMatchLeft2 [NKeyName a]
ys1 [NKeyName b]
ys2
Binding (a, b) -> Maybe (Binding (a, b))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe (a, b) -> [NKeyName (a, b)] -> SourcePos -> Binding (a, b)
forall r. Maybe r -> [NKeyName r] -> SourcePos -> Binding r
Inherit Maybe (a, b)
x [NKeyName (a, b)]
ys SourcePos
l)
zipMatchLeft Binding a
_ Binding b
_ = Maybe (Binding (a, b))
forall a. Maybe a
Nothing
instance Matchable NKeyName where
zipMatchLeft :: NKeyName a -> NKeyName b -> Maybe (NKeyName (a, b))
zipMatchLeft (StaticKey Text
k1) (StaticKey Text
k2) | Text
k1 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
k2 = NKeyName (a, b) -> Maybe (NKeyName (a, b))
forall a. a -> Maybe a
Just (Text -> NKeyName (a, b)
forall r. Text -> NKeyName r
StaticKey Text
k1)
zipMatchLeft (DynamicKey Antiquoted (NString a) a
EscapedNewline) (DynamicKey Antiquoted (NString b) b
EscapedNewline) =
NKeyName (a, b) -> Maybe (NKeyName (a, b))
forall a. a -> Maybe a
Just (Antiquoted (NString (a, b)) (a, b) -> NKeyName (a, b)
forall r. Antiquoted (NString r) r -> NKeyName r
DynamicKey Antiquoted (NString (a, b)) (a, b)
forall v r. Antiquoted v r
EscapedNewline)
zipMatchLeft (DynamicKey (Plain NString a
k1)) (DynamicKey (Plain NString b
k2)) = do
NString (a, b)
k <- NString a -> NString b -> Maybe (NString (a, b))
forall (t :: * -> *) a b.
Matchable t =>
t a -> t b -> Maybe (t (a, b))
zipMatchLeft NString a
k1 NString b
k2
NKeyName (a, b) -> Maybe (NKeyName (a, b))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (NKeyName (a, b) -> Maybe (NKeyName (a, b)))
-> NKeyName (a, b) -> Maybe (NKeyName (a, b))
forall a b. (a -> b) -> a -> b
$ Antiquoted (NString (a, b)) (a, b) -> NKeyName (a, b)
forall r. Antiquoted (NString r) r -> NKeyName r
DynamicKey (NString (a, b) -> Antiquoted (NString (a, b)) (a, b)
forall v r. v -> Antiquoted v r
Plain NString (a, b)
k)
zipMatchLeft (DynamicKey (Antiquoted a
k1)) (DynamicKey (Antiquoted b
k2)) =
NKeyName (a, b) -> Maybe (NKeyName (a, b))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (NKeyName (a, b) -> Maybe (NKeyName (a, b)))
-> NKeyName (a, b) -> Maybe (NKeyName (a, b))
forall a b. (a -> b) -> a -> b
$ Antiquoted (NString (a, b)) (a, b) -> NKeyName (a, b)
forall r. Antiquoted (NString r) r -> NKeyName r
DynamicKey ((a, b) -> Antiquoted (NString (a, b)) (a, b)
forall v r. r -> Antiquoted v r
Antiquoted (a
k1, b
k2))
zipMatchLeft NKeyName a
_ NKeyName b
_ = Maybe (NKeyName (a, b))
forall a. Maybe a
Nothing
instance Matchable Params where
instance Matchable (Ann ann) where
zipMatchLeft :: Ann ann a -> Ann ann b -> Maybe (Ann ann (a, b))
zipMatchLeft (Ann ann
_ a
a1) (Ann ann
ann2 b
a2) = Ann ann (a, b) -> Maybe (Ann ann (a, b))
forall a. a -> Maybe a
Just (Ann ann (a, b) -> Maybe (Ann ann (a, b)))
-> Ann ann (a, b) -> Maybe (Ann ann (a, b))
forall a b. (a -> b) -> a -> b
$ ann -> (a, b) -> Ann ann (a, b)
forall ann a. ann -> a -> Ann ann a
Ann ann
ann2 (a
a1, b
a2)
instance Matchable [] where
instance Matchable NonEmpty where
instance Matchable Maybe where
instance Eq a => Matchable ((,) a) where
instance (Matchable f, Matchable g)=> Matchable (Compose f g) where
class (Traversable t, Generic1 t) => GMatchable t where
gZipMatchLeft :: t a -> t b -> Maybe (t (a,b))
instance GMatchable t => GMatchable (M1 m i t) where
gZipMatchLeft :: M1 m i t a -> M1 m i t b -> Maybe (M1 m i t (a, b))
gZipMatchLeft (M1 t a
l) (M1 t b
r) = t (a, b) -> M1 m i t (a, b)
forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (t (a, b) -> M1 m i t (a, b))
-> Maybe (t (a, b)) -> Maybe (M1 m i t (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> t a -> t b -> Maybe (t (a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft t a
l t b
r
instance GMatchable U1 where
gZipMatchLeft :: U1 a -> U1 b -> Maybe (U1 (a, b))
gZipMatchLeft U1 a
_ U1 b
_ = U1 (a, b) -> Maybe (U1 (a, b))
forall a. a -> Maybe a
Just U1 (a, b)
forall k (p :: k). U1 p
U1
instance Eq c => GMatchable (K1 m c) where
gZipMatchLeft :: K1 m c a -> K1 m c b -> Maybe (K1 m c (a, b))
gZipMatchLeft (K1 c
l) (K1 c
r) | c
l c -> c -> Bool
forall a. Eq a => a -> a -> Bool
== c
r = K1 m c (a, b) -> Maybe (K1 m c (a, b))
forall a. a -> Maybe a
Just (c -> K1 m c (a, b)
forall k i c (p :: k). c -> K1 i c p
K1 c
l)
| Bool
otherwise = Maybe (K1 m c (a, b))
forall a. Maybe a
Nothing
instance GMatchable Par1 where
gZipMatchLeft :: Par1 a -> Par1 b -> Maybe (Par1 (a, b))
gZipMatchLeft (Par1 a
l) (Par1 b
r) = Par1 (a, b) -> Maybe (Par1 (a, b))
forall a. a -> Maybe a
Just (Par1 (a, b) -> Maybe (Par1 (a, b)))
-> ((a, b) -> Par1 (a, b)) -> (a, b) -> Maybe (Par1 (a, b))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a, b) -> Par1 (a, b)
forall p. p -> Par1 p
Par1 ((a, b) -> Maybe (Par1 (a, b))) -> (a, b) -> Maybe (Par1 (a, b))
forall a b. (a -> b) -> a -> b
$ (a
l, b
r)
instance Matchable x => GMatchable (Rec1 x) where
gZipMatchLeft :: Rec1 x a -> Rec1 x b -> Maybe (Rec1 x (a, b))
gZipMatchLeft (Rec1 x a
l) (Rec1 x b
r) = x (a, b) -> Rec1 x (a, b)
forall k (f :: k -> *) (p :: k). f p -> Rec1 f p
Rec1 (x (a, b) -> Rec1 x (a, b))
-> Maybe (x (a, b)) -> Maybe (Rec1 x (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> x a -> x b -> Maybe (x (a, b))
forall (t :: * -> *) a b.
Matchable t =>
t a -> t b -> Maybe (t (a, b))
zipMatchLeft x a
l x b
r
instance (GMatchable l, GMatchable r) => GMatchable (l :+: r) where
gZipMatchLeft :: (:+:) l r a -> (:+:) l r b -> Maybe ((:+:) l r (a, b))
gZipMatchLeft (L1 l a
l) (L1 l b
r) = l (a, b) -> (:+:) l r (a, b)
forall k (f :: k -> *) (g :: k -> *) (p :: k). f p -> (:+:) f g p
L1 (l (a, b) -> (:+:) l r (a, b))
-> Maybe (l (a, b)) -> Maybe ((:+:) l r (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> l a -> l b -> Maybe (l (a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft l a
l l b
r
gZipMatchLeft (R1 r a
l) (R1 r b
r) = r (a, b) -> (:+:) l r (a, b)
forall k (f :: k -> *) (g :: k -> *) (p :: k). g p -> (:+:) f g p
R1 (r (a, b) -> (:+:) l r (a, b))
-> Maybe (r (a, b)) -> Maybe ((:+:) l r (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> r a -> r b -> Maybe (r (a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft r a
l r b
r
gZipMatchLeft (:+:) l r a
_ (:+:) l r b
_ = Maybe ((:+:) l r (a, b))
forall a. Maybe a
Nothing
instance (GMatchable l, GMatchable r) => GMatchable (l :*: r) where
gZipMatchLeft :: (:*:) l r a -> (:*:) l r b -> Maybe ((:*:) l r (a, b))
gZipMatchLeft (l a
l1 :*: r a
l2) (l b
r1 :*: r b
r2) =
l (a, b) -> r (a, b) -> (:*:) l r (a, b)
forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
(:*:) (l (a, b) -> r (a, b) -> (:*:) l r (a, b))
-> Maybe (l (a, b)) -> Maybe (r (a, b) -> (:*:) l r (a, b))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> l a -> l b -> Maybe (l (a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft l a
l1 l b
r1 Maybe (r (a, b) -> (:*:) l r (a, b))
-> Maybe (r (a, b)) -> Maybe ((:*:) l r (a, b))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> r a -> r b -> Maybe (r (a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft r a
l2 r b
r2
instance (Matchable a, GMatchable b) => GMatchable (a :.: b) where
gZipMatchLeft :: (:.:) a b a -> (:.:) a b b -> Maybe ((:.:) a b (a, b))
gZipMatchLeft (Comp1 a (b a)
l) (Comp1 a (b b)
r) = do
a (b (a, b))
x <- a (b a) -> a (b b) -> Maybe (a (b a, b b))
forall (t :: * -> *) a b.
Matchable t =>
t a -> t b -> Maybe (t (a, b))
zipMatchLeft a (b a)
l a (b b)
r Maybe (a (b a, b b))
-> (a (b a, b b) -> Maybe (a (b (a, b)))) -> Maybe (a (b (a, b)))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ((b a, b b) -> Maybe (b (a, b)))
-> a (b a, b b) -> Maybe (a (b (a, b)))
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((b a -> b b -> Maybe (b (a, b))) -> (b a, b b) -> Maybe (b (a, b))
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry b a -> b b -> Maybe (b (a, b))
forall (t :: * -> *) a b.
GMatchable t =>
t a -> t b -> Maybe (t (a, b))
gZipMatchLeft)
(:.:) a b (a, b) -> Maybe ((:.:) a b (a, b))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (a (b (a, b)) -> (:.:) a b (a, b)
forall k2 k1 (f :: k2 -> *) (g :: k1 -> k2) (p :: k1).
f (g p) -> (:.:) f g p
Comp1 a (b (a, b))
x)
(.:) :: (b -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c
.: :: (b -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c
(.:) = ((a2 -> b) -> a2 -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c
forall b c a. (b -> c) -> (a -> b) -> a -> c
(.) (((a2 -> b) -> a2 -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c)
-> ((b -> c) -> (a2 -> b) -> a2 -> c)
-> (b -> c)
-> (a1 -> a2 -> b)
-> a1
-> a2
-> c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (b -> c) -> (a2 -> b) -> a2 -> c
forall b c a. (b -> c) -> (a -> b) -> a -> c
(.)