mirror of
https://github.com/urbit/shrub.git
synced 2024-12-30 15:44:03 +03:00
Merge branch 'pp/proto' of github.com:urbit/urbit into pp/proto
This commit is contained in:
commit
844e568959
@ -53,7 +53,11 @@ ledt v e f = Let e (abstract1 v f)
|
||||
fix :: Eq a => a -> Exp a -> Exp a
|
||||
fix v e = Fix (abstract1 v e)
|
||||
|
||||
|
||||
-- | The expression that returns the given noun as a constant.
|
||||
con :: Noun -> Exp a
|
||||
con = \case
|
||||
A a -> Atm a
|
||||
C n m -> Cel (con n) (con m)
|
||||
|
||||
data CExp a
|
||||
= CVar a
|
||||
|
@ -32,22 +32,20 @@ data Pat
|
||||
= Exact Noun
|
||||
| Wild
|
||||
|
||||
{-
|
||||
|
||||
desugar :: Eq a => Hoon a -> Exp a
|
||||
desugar = go
|
||||
where
|
||||
go = \case
|
||||
HVar v -> Var v
|
||||
HCons h j -> Cel (go h) (go j)
|
||||
BarCen v cs -> Lam $ Scope $ go $ WutHep (Var (B ()))
|
||||
BarWut cs ->
|
||||
CenBar cs -> Fix $ Scope
|
||||
BarCen cs -> undefined --Lam $ Scope $ go $ WutHep (Var (B ()))
|
||||
-- CenBar cs -> Fix $ Scope
|
||||
WutHep h cs -> undefined
|
||||
|
||||
branch :: (Hoon b -> Exp a) -> Exp a -> Cases b -> Exp a
|
||||
branch go e = foldr f Zap
|
||||
where
|
||||
f c acc = case c of
|
||||
(Exact n, h) -> Ift (Eql e
|
||||
f c acc = case c of
|
||||
(Exact n, h) -> Ift (Eql e (con n)) (go h) acc
|
||||
(Wild, h) -> go h
|
||||
|
||||
-}
|
||||
|
Loading…
Reference in New Issue
Block a user