doc[core/expression]: constructor fields

This commit is contained in:
vegowotenks 2025-08-15 18:00:51 +02:00
parent fa8d508e84
commit a38a20a546

View file

@ -29,11 +29,12 @@ import Test.QuickCheck qualified as Gen
type Expression :: (Type -> Type) -> Type type Expression :: (Type -> Type) -> Type
type role Expression nominal type role Expression nominal
data Expression f data Expression f
= RawInt (f Integer) = RawInt (f Integer) -- ^ e.g.: 42
| RawRational (f Rational) | RawRational (f Rational) -- ^ e.g.: 0.3000000000002
| RawString (f Text) | RawString (f Text) -- ^ raw text
| PatternMatch (f (NonEmpty (PatternMatchCase f))) | PatternMatch (f (NonEmpty (PatternMatchCase f))) -- ^ cases
| Lambda (f VariableIdentifier) (f (Expression f)) | Lambda (f VariableIdentifier) (f (Expression f)) -- ^ argument name, calculation
| Apply (f (Expression f)) (f (Expression f)) -- ^ function, argument
-- to me, this looks incredibly dangerous, because of Show (f (Expression f)) => Show (Expression f) -- to me, this looks incredibly dangerous, because of Show (f (Expression f)) => Show (Expression f)
-- let's hope UndecidableInstances won't have the compiler diverge -- let's hope UndecidableInstances won't have the compiler diverge