Commit graph

7 commits

Author SHA1 Message Date
Leonardo de Moura
5ff9e24b17 feat(library/init/control): do not use unnecessary structures
It confuses the compiler.
2018-09-20 08:39:25 -07:00
Leonardo de Moura
d3e225ec65 fix(library/init): missing @[inline] 2018-09-18 21:42:22 -07:00
Sebastian Ullrich
4e2234fd3a feat(library/init/control/state): remove monad_state.lift to avoid allocating tuples 2018-06-28 09:56:26 +02:00
Sebastian Ullrich
51d3ff21eb feat(library/init/control/state): monad_state: add specialized MonadState methods + modify
Absent inlining, these may perform better than `lift` when e.g. used with an
implementation based on unboxed tuples
2018-06-19 13:01:15 +02:00
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
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
77d3a788e8 refactor(init): init/category ==> init.control 2018-04-27 08:33:08 -07:00
Renamed from library/init/category/state.lean (Browse further)