Skip to content

Commit

Permalink
Explain why the closed ConcreteOf is better than Value
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj committed Dec 13, 2023
1 parent 4f0dd9e commit 5368bed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/HordeAd/Core/Ast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ isRankedInt _ = case ( sameAstSpan @s @PrimalSpan
_ -> Nothing

-- | The closed type family that assigns a concrete tensor type
-- to its corresponding AST type.
-- to its corresponding AST type. It could be replaced by @Value@,
-- but it would prevent using a type signature for @DerivativeStages@
-- (unless we accept mandatory kinds in type applications of @rev@, etc.)
-- and some uses of @fwd@, etc., would require extra type applications.
type ConcreteOf :: forall k. TensorKind k -> TensorKind k
type family ConcreteOf f = result | result -> f where
ConcreteOf (AstRanked FullSpan) = Flip OR.Array
Expand Down

0 comments on commit 5368bed

Please sign in to comment.