Skip to content

Commit

Permalink
chore: Comment out inner type signatures which unifies with outer var…
Browse files Browse the repository at this point in the history
…iables

This should hopefully be a temporary measure as adding type holes (or another solution possibly) should allow these signatures to exist.
  • Loading branch information
Marwes committed Aug 5, 2016
1 parent 1f7ff29 commit 0d49b03
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
30 changes: 15 additions & 15 deletions std/prelude.glu
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let monoid_Float_Mul = {
let make_Monoid m =
let { append, empty } = m

let (<>) : m -> m -> m = append
let (<>) /* : m -> m -> m */ = append

{ append, empty, (<>) }

Expand Down Expand Up @@ -310,9 +310,9 @@ let make_Category cat =
let { id, compose } = cat

/// Right-to-left composition. Alias for `compose`.
let (<<) : cat b c -> cat a b -> cat a c = compose
let (<<) /* : cat b c -> cat a b -> cat a c */ = compose
/// Left-to-right composition. Alias for `compose`, but with the arguments flipped.
let (>>) f g : cat a b -> cat b c -> cat a c = compose g f
let (>>) f g /* : cat a b -> cat b c -> cat a c */ = compose g f

{ id, compose, (<<), (>>) }

Expand Down Expand Up @@ -433,11 +433,11 @@ let applicative_IO : Applicative IO =
let make_Applicative app =
let { functor, apply, pure } = app

let (<*>) : app (a -> b) -> app a -> app b = apply
let (<*) l r : app a -> app b -> app a = functor.map const l <*> r
let (*>) l r : app a -> app b -> app b = functor.map (const id) l <*> r
let map2 f a b : (a -> b -> c) -> app a -> app b -> app c = (functor.map f a) <*> b
let map3 f a b c : (a -> b -> c -> d) -> app a -> app b -> app c -> app d = (functor.map f a) <*> b <*> c
let (<*>) /* : app (a -> b) -> app a -> app b */ = apply
let (<*) l r /* : app a -> app b -> app a */ = functor.map const l <*> r
let (*>) l r /* : app a -> app b -> app b */ = functor.map (const id) l <*> r
let map2 f a b /* : (a -> b -> c) -> app a -> app b -> app c */ = (functor.map f a) <*> b
let map3 f a b c /* : (a -> b -> c -> d) -> app a -> app b -> app c -> app d */ = (functor.map f a) <*> b <*> c

{ functor, apply, pure, (<*>), (<*), (*>), map2, map3 }

Expand Down Expand Up @@ -466,12 +466,12 @@ let make_Alternative f =
let { applicative, or, empty } = f
let { functor, (<*>), pure } = make_Applicative applicative

let (<|>) : f a -> f a -> f a = or
let many x : f a -> f (List a) =
let (<|>) /* : f a -> f a -> f a */ = or
let many x /* : f a -> f (List a) */ =
let many_v _ = some_v () <|> pure Nil
and some_v _ = functor.map (\h l -> Cons h l) x <*> many_v ()
many_v ()
let some x : f a -> f (List a) =
let some x /* : f a -> f (List a) */ =
let many_v _ = some_v () <|> pure Nil
and some_v _ = functor.map (\h l -> Cons h l) x <*> many_v ()
some_v ()
Expand Down Expand Up @@ -516,10 +516,10 @@ let make_Monad m =
let { (*>), pure } = make_Applicative applicative
let { id } = category_Function

let (=<<) : (a -> m b) -> m a -> m b = flat_map
let (>>=) : m a -> (a -> m b) -> m b = flip flat_map
let join mm : m (m a) -> m a = mm >>= id
let forM_ xs f : List a -> (a -> m b) -> m () =
let (=<<) /* : (a -> m b) -> m a -> m b */ = flat_map
let (>>=) /* : m a -> (a -> m b) -> m b */ = flip flat_map
let join mm /* : m (m a) -> m a */ = mm >>= id
let forM_ xs f /* : List a -> (a -> m b) -> m () */ =
match xs with
| Cons y ys -> f y *> forM_ ys f
| Nil -> pure ()
Expand Down
7 changes: 5 additions & 2 deletions tests/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ fn read_file() {
assert (array.index bytes 1 #Byte== 112b) // p
pure (array.index bytes 8)
"#;
let (result, _) = Compiler::new().run_io_expr::<u8>(&thread, "<top>", text).unwrap();
let result = Compiler::new().run_io_expr::<u8>(&thread, "<top>", text);

assert_eq!(result, b']');
match result {
Ok((value, _)) => assert_eq!(value, b']'),
Err(err) => assert!(false, "{}", err),
}
}

0 comments on commit 0d49b03

Please sign in to comment.