Commit graph

13 commits

Author SHA1 Message Date
Sebastian Ullrich
bba55aad47 feat(library/init/lean/trace): implement conditional tracing via good old trace classes 2018-05-18 14:52:15 +02:00
Leonardo de Moura
fbac1d45a3 refactor(library/init/control/combinators): move nat.mrepeat to combinators 2018-05-13 11:34:39 -07:00
Leonardo de Moura
8a6d2125b3 chore(library/init/control/combinators): remove top-level mmap and related combinators
The top-level `mmap` should use the `traversable` typeclass that will be
defined in the future.
2018-05-09 15:49:13 -07:00
Leonardo de Moura
014735e498 feat(library/init/control/combinators): remove unnecessary universe constraint from list.mmap'
This commit also adds the alias `mfor` for `mmap'`
2018-05-09 15:38:35 -07:00
Leonardo de Moura
83415ea44c feat(library/init/control/except): add instance has_monad_lift (except ε) (except_t ε m) 2018-05-09 12:19:44 -07:00
Leonardo de Moura
874f9caf13 feat(library/init/control/state): modify monad_run instance for state_t
@Kha, I was having to use `(run ...).1` in many places
in my code. So, I changed the instance
```
instance (σ m out) [monad_run out m] : monad_run (λ α, σ → out (α × σ)) (state_t σ m) :=
⟨λ α x, run ∘ (λ σ, x.run σ)⟩
```
to
```
instance (σ : Type u) (m out : Type u → Type v) [functor m] [monad_run out m] : monad_run (λ α, σ → out α) (state_t σ m) :=
⟨λ α x, run ∘ (λ σ, prod.fst <$> (x.run σ))⟩
```
If we want to get the resultant state in an action `act`, we can just
use `run (act >> get) init_state`.
2018-05-08 17:32:54 -07:00
Leonardo de Moura
4f75e49da8 feat(library/init/control/except): add monad_except _ except instance 2018-05-08 15:38:20 -07:00
Leonardo de Moura
e40f37b08e feat(library/init/lean/ir): add type checker 2018-05-07 18:07:04 -07:00
Leonardo de Moura
d5fe509c36 chore(*): remove end after each match-expression
`end` is not optional anymore
2018-05-04 11:30:06 -07:00
Leonardo de Moura
2cb6af9769 refactor(library/init/control): remove init.meta.name spurious dependency 2018-04-30 11:36:07 -07:00
Leonardo de Moura
9efd07d18c chore(library/init): move logic.lean => core.lean 2018-04-30 09:25:25 -07:00
Leonardo de Moura
13ba9ca176 feat(library/init/control/except): add has_repr and has_to_string instances 2018-04-27 13:39:19 -07:00
Leonardo de Moura
77d3a788e8 refactor(init): init/category ==> init.control 2018-04-27 08:33:08 -07:00