Skip to content

Commit

Permalink
Merge branch 'master' of github.com:uvm-plaid/uvmhs
Browse files Browse the repository at this point in the history
  • Loading branch information
davdar committed Jun 18, 2024
2 parents cebfe89 + aaeb568 commit 21140e8
Show file tree
Hide file tree
Showing 97 changed files with 1,465 additions and 1,480 deletions.
10 changes: 4 additions & 6 deletions _scratch/ADThrowaway.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-- Dual Number Forward Generic --
---------------------------------

data DNF a b = DNF
data DNF a b = DNF
{ dnfVal a
, dnfDer b
} deriving (Eq,Ord,Show)
Expand Down Expand Up @@ -149,7 +149,7 @@ deriving instance (𝒩 m,𝒩 n) ⇒ Times (DNFJ𝔻 m n)
-- Dual Number Backward Generic --
----------------------------------

data DNB a b = DNB
data DNB a b = DNB
{ dnbVal a
, dnbDer a b
}
Expand All @@ -163,7 +163,7 @@ sensDNB ∷ a → (a → b) → DNB a b
sensDNB = DNB

plusDNB (Plus a,Plus b) DNB a b DNB a b DNB a b
plusDNB (DNB v₁ d₁) (DNB v₂ d₂) = DNB (v₁ + v₂) $ \ δ
plusDNB (DNB v₁ d₁) (DNB v₂ d₂) = DNB (v₁ + v₂) $ \ δ
d₁ δ + d₂ δ

timesDNB (Times a,Plus b) DNB a b DNB a b DNB a b
Expand Down Expand Up @@ -305,7 +305,7 @@ type DNBMC = AllCC 𝒩

data DNBM (ms [𝐍]) (nss [[𝐍]]) a = DNBM
{ dnbmVal 𝕄S ms a
, dnbmDer 𝕄S ms a 𝐿S nss DNBMC (𝕄S' a) 𝐿S nss DNBMC (𝕄S' a)
, dnbmDer 𝕄S ms a 𝐿S nss DNBMC (𝕄S' a) 𝐿S nss DNBMC (𝕄S' a)
}
makeLenses ''DNBM
makePrettySum ''DNBM
Expand All @@ -329,5 +329,3 @@ timesDNBM ∷ (AllC 𝒩 ms,Times a) ⇒ DNBM ms nss a → DNBM ms nss a → DNB
timesDNBM (DNBM v₁ 𝒹₁) (DNBM v₂ 𝒹₂) = DNBM (v₁ × v₂) $ \ d 𝒹₁ (d × v₂) 𝒹₂ (d × v₁)

-- }}}


7 changes: 3 additions & 4 deletions _scratch/Fr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data FrI hᴵ hᴼ o a where
Fr1 h o a. Tr h o a FrI h h o a
Fr2 hho a. Br ho a Fr ('S hᴵ) ho a Br ho a FrI hho a

data ExTallFr h o a where
data ExTallFr h o a where
EqTlFr h o a. Fr 'Z h o a ExTallFr h o a
SuccFr h o a. Fr 'Z ('S h) o a ExTallFr h o a

Expand Down Expand Up @@ -297,7 +297,7 @@ snocFrK f x (InFr2 bˡ () bʳ c) = consFrBrK x bʳ $ InFr2R bˡ f () c

insertPosFr (Monoid o,Summary o a) a PositionFr h o a ExTallFr h o a
insertPosFr x (PositionFr0 c) = consFrK x fr0 c
insertPosFr x (PositionFr2 d f c) = case d of
insertPosFr x (PositionFr2 d f c) = case d of
Left consFrK x f c
Right snocFrK f x c
insertPosFr x (PositionFrBr d b c) = case d of
Expand Down Expand Up @@ -396,7 +396,7 @@ data FrK𝑆 o a where
data BrInFr𝑆 o a where
InFr2L𝑆 hho a. () Fr ('S hᴵ) ho a Br ho a FrK𝑆 o a BrInFr𝑆 o a
InFr2R𝑆 o a . () FrK𝑆 o a BrInFr𝑆 o a

data TrInFr𝑆 o a where
InFr1𝑆 o a. () FrK𝑆 o a TrInFr𝑆 o a
InBr1𝑆 o a. () BrInFr𝑆 o a TrInFr𝑆 o a
Expand Down Expand Up @@ -438,4 +438,3 @@ streamFr f = 𝑆 (locFstFr𝑆 f TopFr𝑆) $ \case
Some (x :* c :* cc) Some (x :* nextFr𝑆 c cc)

instance ToStream a (Fr hho a) where stream = streamFr

10 changes: 5 additions & 5 deletions _scratch/Lib/Parser/Fast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ data CParser t a = CParser
, cParserFallback Formats (𝐼 t Parser t a)
}

instance Return (CParser t) where
instance Return (CParser t) where
-- {-# INLINE return #-}
return a. a CParser t a
return x = CParserNone $ null const (return x)
instance (Ord t) Bind (CParser t) where
-- {-# INLINE (≫=) #-}
(≫=) a b. CParser t a (a CParser t b) CParser t b
CParser n nf f ≫= k =
CParser (map (mapCResultsParsers $ extend k) n)
(map (mapCResultsParsers $ extend k) nf)
CParser n nf f ≫= k =
CParser (map (mapCResultsParsers $ extend k) n)
(map (mapCResultsParsers $ extend k) nf)
(map (map $ extend $ cparser k) f)
instance (Ord t) Functor (CParser t) where map = mmap
instance (Ord t) Monad (CParser t)
Expand Down Expand Up @@ -104,5 +104,5 @@ cunit fm f = CParser dø None $ fm ↦ return ∘ f

-- {-# INLINE cpWord #-}
cpWord s t. (Ord t,Eq t,s 𝐼 t) Formats s CParser t s
cpWord fm ts = foldrOnFrom (isoto ts) (cunit fm isofr) $ \ c cp
cpWord fm ts = foldrOnFrom (isoto ts) (cunit fm isofr) $ \ c cp
CParser (c CResults False {--} cp) (Some (CResults True {- null -} {- (single $ ppshow ts) -} null)) dø
Loading

0 comments on commit 21140e8

Please sign in to comment.