Skip to content

Instantly share code, notes, and snippets.

@MarcelineVQ
Last active June 2, 2020 10:44
Show Gist options
  • Save MarcelineVQ/69f11ead89b01ce32b3d11a25b0c779c to your computer and use it in GitHub Desktop.
Save MarcelineVQ/69f11ead89b01ce32b3d11a25b0c779c to your computer and use it in GitHub Desktop.
-- given (%pi RigW Explicit Nothing %type (%pi RigW Explicit Nothing %type %type))
-- only
-- getArity' (IPi _ _ _ _ _ retTy) = ...
-- matches. None of the other PiInfo cases match, ExplicitArg/ImplicitArg etc
getArity' : TTImp -> Nat
getArity' (IPi _ M0 _ _ _ retTy) = getArity' retTy
getArity' (IPi _ _ ExplicitArg _ _ retTy) = S (getArity' retTy)
getArity' (IPi _ _ ImplicitArg _ _ retTy) = S (getArity' retTy)
getArity' (IPi _ _ (DefImplicit _) _ _ retTy) = S (getArity' retTy)
getArity' (IPi _ _ AutoImplicit _ _ retTy) = S (getArity' retTy)
getArity' (IPi _ _ _ _ _ retTy) = 5 + getArity' retTy
getArity' (IType _) = Z
getArity' _ = 12 -- just some testing number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment