Skip to content

Commit

Permalink
test(std): removed hack unneeded as of gluon-lang#710
Browse files Browse the repository at this point in the history
  • Loading branch information
Etherian committed Apr 17, 2019
1 parent b39b577 commit c0fa355
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions tests/pass/statet.glu
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ let right_identity x : [Eq a] -> [Show a] -> a -> _ = \_ ->
assert_eq (eval_state_t (mx >>= wrap) s) (eval_state_t mx s)

let associativity ?mo mx f g : [Monad m] -> [Show (m a)] -> [Eq (m a)] -> m a -> _ -> _ -> _ = \_ ->
// NOTE necessary because implicit records are currently only traversed one level
let functor = mo.applicative.functor

let mx : StateT _ m _ = wrap_monad mx
let s = ()
assert_eq (eval_state_t ((mx >>= f) >>= g) s) (eval_state_t (mx >>= (\x -> f x >>= g)) s)
Expand All @@ -46,14 +43,14 @@ group "statet" [
test "put get run_state_t" <| \_ -> (assert_eq (run_state_t (put "hello" *> get) "") <| Some {value = "hello", state = "hello"}),
test "gets eval_state_t" <| \_ -> (assert_eq (eval_state_t (gets <| (::) 1) (2 :: 3 :: Nil)) <| Some (1 :: 2 :: 3 :: Nil)),
],
// TODO
// should this be moved to std.transformer?
// StateT s m -> m -> f : (m a -> m b)
// group "StateT s m has effects of monad m" [
// test "Option", <| \_ -> (assert_eq
// test "List", <| \_ -> (assert_eq
// test "State String", <| \_ -> (assert_eq
// test "Writer", <| \_ -> (assert_eq
// test "Reader", <| \_ -> (assert_eq
// test "Result Int", <| \_ -> (assert_eq
// ],
// group "StateT s m has effects of monad m" [
// test "Option", <| \_ -> (assert_eq
// test "List", <| \_ -> (assert_eq
// test "State String", <| \_ -> (assert_eq
// test "Writer", <| \_ -> (assert_eq
// test "Reader", <| \_ -> (assert_eq
// test "Result Int", <| \_ -> (assert_eq
// ],
]

0 comments on commit c0fa355

Please sign in to comment.