Commit graph

16 commits

Author SHA1 Message Date
Leonardo de Moura
af968c60e6 chore: cleanup 2020-10-22 07:32:23 -07:00
Leonardo de Moura
faa59ead97 chore: move to new frontend 2020-10-20 13:46:16 -07:00
Leonardo de Moura
9810b405d9 feat: add CodeBlock to Syntax converter 2020-10-04 16:19:09 -07:00
Leonardo de Moura
f4aabaecae refactor: move Lean.quote to LeanInit
cc @Kha
2020-09-17 08:15:58 -07:00
Leonardo de Moura
35b11d582d chore: naming convention 2020-08-30 14:26:03 -07:00
Sebastian Ullrich
eb5a171764 feat: adjust semantics to new syntax 2020-08-19 09:56:23 -07:00
Sebastian Ullrich
3bddb90bd0 refactor: move isQuot/isAntiquot 2020-08-19 09:56:23 -07:00
Leonardo de Moura
58c4d8bfc0 refactor: add MonadStateOf
@Kha I tried to remove `MonadExceptOf` by adding `HasThrow` and
`HasCatch`, but this change impacts our ability to define polymorphic
methods such as `finally` which is parametrized by `[MonadExcept]`.
If we remove the `outParam` from `[MonadExcept]`, then we will need to
know the exception at `finally`, or add two instances `[HasCatch]` and
`[HasThrow]`. So, it seems it is more convenient to have
`[MonadExceptOf]` and `[MonadExcept]`. Thus, I applied this approach
to `[MonadState]`
2020-08-18 16:35:33 -07:00
Leonardo de Moura
5605735137 feat: remove outparam from MonadState
We add helper classes with `outParam`.

@Kha This is similar to the `MonadExceptOf` modification.
Motivation: the new `StateRefT` (state monad implemented using
`IO.Ref`) makes is it quite cheap to have multiple states on the
stack. But, we need a mechanism for accessing the different states in
a convenient way.
Note that, I did not add a `MonadStateOf` class, but helper classes
such as `HasGet` which uses `outParam`. I will do the same for `MonadExcept`.

Summary:
- `get` gets the state on the top of the Monad stack
- `getThe σ` gets the state with type `σ`
- `modify f` modifies the state on the top of the Monad stack.
   We use `modify fun s => { s with ... }` quite often, and we cannot
   infer type of `s` here.
- `modifyThe σ f` allows us to select which state on the stack we are modifying.
- I didn't add `setThe`, since we usually can infer the state type at
  `set s`. In the whole codebase, we have only one instance where this
  is not true.
2020-08-18 15:15:31 -07:00
Leonardo de Moura
fe5927927a feat: elaborate match type 2020-08-10 13:53:08 -07:00
Sebastian Ullrich
a0b0dbd0ac fix: formatStx 2020-08-06 09:27:12 -07:00
Sebastian Ullrich
c5d226ba36 feat: HasBeq for Syntax, Substring 2020-08-06 09:26:49 -07:00
Sebastian Ullrich
d23625324c refactor: move Syntax.Traverser 2020-07-29 15:18:00 +02:00
Leonardo de Moura
249bda16c0 chore: remove prelude commands from Lean package 2020-06-25 11:21:17 -07:00
Sebastian Ullrich
f5a575b847 feat: getAtomVal! 2020-06-15 19:35:47 +02:00
Leonardo de Moura
4ccc3fef52 chore: move Init.Lean files to Lean package 2020-05-26 15:04:35 -07:00
Renamed from src/Init/Lean/Syntax.lean (Browse further)