diff options
author | Tom Smeding <t.j.smeding@uu.nl> | 2025-01-28 16:58:51 +0100 |
---|---|---|
committer | Tom Smeding <t.j.smeding@uu.nl> | 2025-01-28 16:58:51 +0100 |
commit | 3e04b03acd5e7138e0f6241133585f22ddb73060 (patch) | |
tree | 57b60cf7a784e3e1ece6c05afecff52eb4beb6db /src/AST.hs | |
parent | 817cd3c75a2bbbbb355ac33fc7ca3ad8a16bdc92 (diff) |
Pretty-printer that supports extension fields
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -256,6 +256,42 @@ typeOf = \case EError _ t _ -> t +extOf :: Expr x env t -> x t +extOf = \case + EVar x _ _ -> x + ELet x _ _ -> x + EPair x _ _ -> x + EFst x _ -> x + ESnd x _ -> x + ENil x -> x + EInl x _ _ -> x + EInr x _ _ -> x + ECase x _ _ _ -> x + ENothing x _ -> x + EJust x _ -> x + EMaybe x _ _ _ -> x + EConstArr x _ _ _ -> x + EBuild x _ _ _ -> x + EFold1Inner x _ _ _ -> x + ESum1Inner x _ -> x + EUnit x _ -> x + EReplicate1Inner x _ _ -> x + EMaximum1Inner x _ -> x + EMinimum1Inner x _ -> x + EConst x _ _ -> x + EIdx0 x _ -> x + EIdx1 x _ _ -> x + EIdx x _ _ -> x + EShape x _ -> x + EOp x _ _ -> x + ECustom x _ _ _ _ _ _ _ _ -> x + EWith x _ _ -> x + EAccum x _ _ _ _ -> x + EZero x _ -> x + EPlus x _ _ _ -> x + EOneHot x _ _ _ _ -> x + EError x _ _ -> x + -- unSNat :: SNat n -> Nat -- unSNat SZ = Z -- unSNat (SS n) = S (unSNat n) |