Leonardo de Moura
afd54039ab
chore(library): remove >>, we should use *>
2018-09-12 17:31:21 -07:00
Leonardo de Moura
9e305a5f26
chore(library): remove return, we should use pure
2018-09-12 16:51:11 -07:00
Leonardo de Moura
af1a5fe874
feat(library/init/lean/ir): add x : ty := y instruction
...
It is useful when we are not producing IR in SSA.
2018-05-17 15:44:13 -07:00
Leonardo de Moura
5d53eccb59
feat(runtime): string support
2018-05-17 13:11:47 -07:00
Leonardo de Moura
cf36d8b08e
refactor(library/init/lean/ir): rename ir.instr constructors
2018-05-15 14:48:12 -07:00
Leonardo de Moura
272f80c799
feat(library/init/lean/ir): add string_push and string_append instructions
2018-05-15 14:27:10 -07:00
Leonardo de Moura
be74e3f974
refactor(library/init/lean/ir): add init/lean/ir/instances.lean
2018-05-15 12:14:36 -07:00
Leonardo de Moura
68458aa97b
refactor(library/init/lean/ir): array operations
2018-05-10 09:52:00 -07:00
Leonardo de Moura
f1535121b9
refactor(library/init/lean/ir): combine unary instructions
2018-05-10 09:19:13 -07:00
Leonardo de Moura
655cfbf3b0
refactor(library/init/lean/ir): read and sread instructions are now binop
2018-05-10 08:47:16 -07:00
Leonardo de Moura
5baae4724f
feat(library/init/lean/ir): distinguish free and dealloc
2018-05-09 17:43:12 -07:00
Leonardo de Moura
3be7540efe
chore(library/init): use mfor instead of mmap'
2018-05-09 15:41:53 -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
b0641ba770
feat(frontends/lean/elaborator): add support for definitions such as monad_run.run
...
cc @Kha
2018-05-08 17:14:52 -07:00
Leonardo de Moura
60a275a464
chore(library/init/lean/ir/elim_phi): use idiom: define run for every monad
2018-05-08 15:46:30 -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
883f6923e2
chore(library/init/lean/ir/elim_phi): fix typo
2018-05-06 10:15:17 -07:00
Leonardo de Moura
e2e124626f
feat(library/init/lean/ir): add elim_phi function
2018-05-06 10:07:44 -07:00