[bitc-dev] Is forall really syntax?

Aleksi Nurmi aleksi.nurmi at helsinki.fi
Wed Mar 31 22:06:27 PDT 2010


2010/3/31 Jonathan S. Shapiro <shap at eros-os.org>:
> Pardon my stupidity, but why isn't forall just a function? It takes an
> interable thing and a procedure to be applied to the elements of the
> iterable thing.

In Haskell, it's

forM_ list $ \x -> do
  doSomething x
  ...

and forM without the underscore returns a value - it's essentially a
map that works with monads and has its arguments flipped. Due to the
use of effects instead of monads, BitC can unify for and forM.

Note that $ is a function application operator and used to get rid of
the parenthesis.


More information about the bitc-dev mailing list