Skip to content

Rational arithmetic rebased#142

Merged
sfultong merged 13 commits intoStand-In-Language:masterfrom
hhefesto:rationalArithmeticRebased
Jan 20, 2026
Merged

Rational arithmetic rebased#142
sfultong merged 13 commits intoStand-In-Language:masterfrom
hhefesto:rationalArithmeticRebased

Conversation

@hhefesto
Copy link
Copy Markdown
Contributor

ready to fast forward

@hhefesto hhefesto force-pushed the rationalArithmeticRebased branch from d5b8e46 to 96eb5c2 Compare January 16, 2026 23:52
then right i
else abort "Not a Rational"
)
in wrapper (# wrapper)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my dream is to eventually be able to do something like this:

[Nat, toNat, nPlus, nMinus]
  = let wrapper = \h ->
                let N = \(hc, _) x -> assert (dEqual hc h) "not Natural"
                in [ N
                   , \x -> (h, x)
                   , \((_, aa) : N) ((_, bb) : N) -> (h, d2c aa succ bb)
                   , \((_, aa) : N) ((_, bb) : N) ->
                       let sLeft = \x -> case x of
                                              (l, _) -> l
                                              abort "can't subtract larger number from smaller one"
                       in (h, d2c bb sLeft aa)
                   ]
    in wrapper (# wrapper)

but that requires parser changes

@sfultong sfultong merged commit 59c2e33 into Stand-In-Language:master Jan 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants