main_in_haskell.cpp 624 B

1234567891011121314151617181920
  1. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2012.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #include <example_in_haskell.hpp>
  6. #include <iostream>
  7. int main()
  8. {
  9. using boost::mpl::int_;
  10. std::cout
  11. << "fib 6 = " << fib::apply<int_<6> >::type::value << std::endl
  12. << "fact 4 = " << fact::apply<int_<4> >::type::value << std::endl
  13. << "times4 3 = " << times4::apply<int_<3> >::type::value << std::endl
  14. << "times11 2 = " << times11::apply<int_<2> >::type::value << std::endl;
  15. }