Skip to content

Commit

Permalink
Fix typos (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
tocic committed Mar 27, 2023
1 parent 63ac019 commit 814f2be
Show file tree
Hide file tree
Showing 28 changed files with 53 additions and 53 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
About
=====

HigherOrderFunctions is a header-only C++11/C++14 library that provides utilities for functions and function objects, which can solve many problems with much simpler constructs than whats traditionally been done with metaprogramming.
HigherOrderFunctions is a header-only C++11/C++14 library that provides utilities for functions and function objects, which can solve many problems with much simpler constructs than what's traditionally been done with metaprogramming.

HigherOrderFunctions is:

- Modern: HigherOrderFunctions takes advantages of modern C++11/C++14 features. It support both `constexpr` initialization and `constexpr` evaluation of functions. It takes advantage of type deduction, variadic templates, and perfect forwarding to provide a simple and modern interface.
- Modern: HigherOrderFunctions takes advantages of modern C++11/C++14 features. It supports both `constexpr` initialization and `constexpr` evaluation of functions. It takes advantage of type deduction, variadic templates, and perfect forwarding to provide a simple and modern interface.
- Relevant: HigherOrderFunctions provides utilities for functions and does not try to implement a functional language in C++. As such, HigherOrderFunctions solves many problems relevant to C++ programmers, including initialization of function objects and lambdas, overloading with ordering, improved return type deduction, and much more.
- Lightweight: HigherOrderFunctions builds simple lightweight abstraction on top of function objects. It does not require subscribing to an entire framework. Just use the parts you need.

Expand All @@ -17,7 +17,7 @@ HigherOrderFunctions is divided into three components:
* Functions: These return functions that achieve a specific purpose.
* Utilities: These are general utilities that are useful when defining or using functions

Github: [https://github.com/boostorg/hof/](https://github.com/boostorg/hof/)
GitHub: [https://github.com/boostorg/hof/](https://github.com/boostorg/hof/)

Documentation: [http://boost-hof.readthedocs.io/](http://boost-hof.readthedocs.io/)

Expand All @@ -34,7 +34,7 @@ Requirements

This requires a C++11 compiler. There are no third-party dependencies. This has been tested on clang 3.5-3.8, gcc 4.6-7, and Visual Studio 2015 and 2017.

Contexpr support
Constexpr support
----------------

Both MSVC and gcc 4.6 have limited constexpr support due to many bugs in the implementation of constexpr. However, constexpr initialization of functions is supported when using the [`BOOST_HOF_STATIC_FUNCTION`](BOOST_HOF_STATIC_FUNCTION) and [`BOOST_HOF_STATIC_LAMBDA_FUNCTION`](BOOST_HOF_STATIC_LAMBDA_FUNCTION) constructs.
Expand Down Expand Up @@ -67,7 +67,7 @@ The tests can be built and run by using the `check` target:

cmake --build . --target check

The tests can also be ran using Boost.Build, just copy library to the boost source tree, and then:
The tests can also be run using Boost.Build, just copy library to the boost source tree, and then:

cd test
b2
Expand Down
2 changes: 1 addition & 1 deletion doc/src/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The tests can be built and run by using the `check` target:

cmake --build . --target check

The tests can also be ran using Boost.Build, just copy library to the boost source tree, and then:
The tests can also be run using Boost.Build, just copy library to the boost source tree, and then:

cd test
b2
Expand Down
2 changes: 1 addition & 1 deletion doc/src/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Given
BinaryFunctionObject
--------------------

Is an object with a `const` call operator that accepts two parameter:
Is an object with a `const` call operator that accepts two parameters:

```cpp
concept UnaryFunctionObject
Expand Down
4 changes: 2 additions & 2 deletions doc/src/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ FunctionAdaptor Decorator(Ts...);
Semantics
---------
Some parts of the documentation provides the meaning(or equivalence) of an expression. Here is a guide of those symbols:
Some parts of the documentation provide the meaning(or equivalence) of an expression. Here is a guide of those symbols:
* `f`, `g`, `fs`, `gs`, `p` are functions
* `x`, `y`, `xs`, `ys` are parameters to a function
* `T` represents some type
* `...` are parameter packs and represent varidiac parameters
* `...` are parameter packs and represent variadic parameters
Signatures
----------
Expand Down
4 changes: 2 additions & 2 deletions doc/src/example_print.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Say, for example, we would like to write a print function. We could start by wri
std::cout << x << std::endl;
};

However, there is lot of things that don't print directly to `std::cout` such as `std::vector` or `std::tuple`. Instead, we want to iterate over these data structures and print each element in them.
However, there are a lot of things that don't print directly to `std::cout` such as `std::vector` or `std::tuple`. Instead, we want to iterate over these data structures and print each element in them.

Overloading
-----------
Expand Down Expand Up @@ -132,7 +132,7 @@ Recursive

Even though this will print for ranges and tuples, if we were to nest a range into a tuple this would not work. What we need to do is make the function call itself recursively. Even though we are using lambdas, we can easily make this recursive using the [`fix`](/include/boost/hof/fix) adaptor. This implements a fix point combinator, which passes the function(i.e. itself) in as the first argument.

So now we add an additional arguments called `self` which is the `print` function itself. This extra argument is called by the [`fix`](/include/boost/hof/fix) adaptor, and so the user would still call this function with a single argument:
So now we add an additional argument called `self` which is the `print` function itself. This extra argument is called by the [`fix`](/include/boost/hof/fix) adaptor, and so the user would still call this function with a single argument:

BOOST_HOF_STATIC_LAMBDA_FUNCTION(print) = fix(first_of(
[](auto, const auto& x) -> decltype(std::cout << x, void())
Expand Down
2 changes: 1 addition & 1 deletion doc/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FAQ

Mutable function objects are not prohibited, they just need to be explicit by
using the adaptor [`mutable_`](/include/boost/hof/mutable). The main reason for this, is that it can lead to
many suprising behaviours. Many times function objects are copied by value
many surprising behaviours. Many times function objects are copied by value
everywhere. For example,

```cpp
Expand Down
6 changes: 3 additions & 3 deletions doc/src/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ There are few things to note about this. First, the call operator member functio
std::vector<int> v = { 1, 2, 3 };
int total = std::accumulate(v.begin(), v.end(), 0, sum);

Because the function is templated, it can be called on any type that has the plus `+` operator, not just integers. Futhermore, the `sum` variable can be used to refer to the entire overload set.
Because the function is templated, it can be called on any type that has the plus `+` operator, not just integers. Furthermore, the `sum` variable can be used to refer to the entire overload set.

Lifting functions
-----------------
Expand All @@ -81,7 +81,7 @@ Another alternative to defining a function object, is to lift the templated func
std::vector<int> v = { 1, 2, 3 };
int total = std::accumulate(v.begin(), v.end(), 0, BOOST_HOF_LIFT(sum));

However, due to limitations in C++14 this will not preserve `constexpr`. In those cases, its better to use a function object.
However, due to limitations in C++14 this will not preserve `constexpr`. In those cases, it's better to use a function object.

Declaring functions
-------------------
Expand All @@ -107,7 +107,7 @@ Then the parameters can be piped into it, like this:

auto three = 1 | sum(2);

Pipable function can be chained mutliple times just like the `.` operator:
Pipable function can be chained multiple times just like the `.` operator:

auto four = 1 | sum(2) | sum(1);

Expand Down
10 changes: 5 additions & 5 deletions doc/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
About
=====

HigherOrderFunctions is a header-only C++11/C++14 library that provides utilities for functions and function objects, which can solve many problems with much simpler constructs than whats traditionally been done with metaprogramming.
HigherOrderFunctions is a header-only C++11/C++14 library that provides utilities for functions and function objects, which can solve many problems with much simpler constructs than what's traditionally been done with metaprogramming.

HigherOrderFunctions is:

- Modern: HigherOrderFunctions takes advantages of modern C++11/C++14 features. It support both `constexpr` initialization and `constexpr` evaluation of functions. It takes advantage of type deduction, varidiac templates, and perfect forwarding to provide a simple and modern interface.
- Modern: HigherOrderFunctions takes advantages of modern C++11/C++14 features. It supports both `constexpr` initialization and `constexpr` evaluation of functions. It takes advantage of type deduction, variadic templates, and perfect forwarding to provide a simple and modern interface.
- Relevant: HigherOrderFunctions provides utilities for functions and does not try to implement a functional language in C++. As such, HigherOrderFunctions solves many problems relevant to C++ programmers, including initialization of function objects and lambdas, overloading with ordering, improved return type deduction, and much more.
- Lightweight: HigherOrderFunctions builds simple lightweight abstraction on top of function objects. It does not require subscribing to an entire framework. Just use the parts you need.

Expand All @@ -20,14 +20,14 @@ HigherOrderFunctions is divided into three components:
* Functions: These return functions that achieve a specific purpose.
* Utilities: These are general utilities that are useful when defining or using functions

Github: [https://github.com/pfultz2/higherorderfunctions/](https://github.com/pfultz2/higherorderfunctions/)
GitHub: [https://github.com/pfultz2/higherorderfunctions/](https://github.com/pfultz2/higherorderfunctions/)

Documentation: [http://pfultz2.github.io/higherorderfunctions/doc/html/](http://pfultz2.github.io/higherorderfunctions/doc/html/)

Motivation
==========

- Improve the expressiveness and capabilities of functions, including first-class citzens for function overload set, extension methods, infix operators and much more.
- Improve the expressiveness and capabilities of functions, including first-class citizens for function overload set, extension methods, infix operators and much more.
- Simplify constructs in C++ that have generally required metaprogramming
- Enable point-free style programming
- Workaround the limitations of lambdas in C++14
Expand All @@ -37,7 +37,7 @@ Requirements

This requires a C++11 compiler. There are no third-party dependencies. This has been tested on clang 3.5-3.8, gcc 4.6-7, and Visual Studio 2015 and 2017.

Contexpr support
Constexpr support
----------------

Both MSVC and gcc 4.6 have limited constexpr support due to many bugs in the implementation of constexpr. However, constexpr initialization of functions is supported when using the [`BOOST_HOF_STATIC_FUNCTION`](BOOST_HOF_STATIC_FUNCTION) and [`BOOST_HOF_STATIC_LAMBDA_FUNCTION`](BOOST_HOF_STATIC_LAMBDA_FUNCTION) constructs.
Expand Down
8 changes: 4 additions & 4 deletions doc/src/more_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ More examples
=============

As Boost.HigherOrderFunctions is a collection of generic utilities
related to functions, there is many useful cases with the library, but a key
related to functions, there are many useful cases with the library, but a key
point of many of these utilities is that they can solve these problems with
much simpler constructs than whats traditionally been done with
metaprogramming. Lets take look at some of the use cases for using Boost.HigherOrderFunctions.
much simpler constructs than what's traditionally been done with
metaprogramming. Let's take look at some of the use cases for using Boost.HigherOrderFunctions.

Initialization
--------------
Expand Down Expand Up @@ -75,7 +75,7 @@ It would be nice to write this:

The proposal [N4165](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4165.pdf)
for Unified Call Syntax(UFCS) would have allowed a function call of `x.f(y)` to become
`f(x, y)`. However, this was rejected by the comittee. So instead pipable functions can be
`f(x, y)`. However, this was rejected by the committee. So instead pipable functions can be
used to achieve extension methods. So it can be written like this:

auto r = numbers
Expand Down
2 changes: 1 addition & 1 deletion doc/src/partialfunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Of course due to limitations in C++, deciding whether evaluate the function or t

auto f = sum(1, 2, 3);

However, this can get out of hande as the function `f` will never be evaluated. Plus, it would be nice to produce an error at the point of calling the function rather than a confusing error of trying to use a partial function. The [limit](limit) decorator lets us annotate the function with the max arity:
However, this can get out of hand as the function `f` will never be evaluated. Plus, it would be nice to produce an error at the point of calling the function rather than a confusing error of trying to use a partial function. The [limit](limit) decorator lets us annotate the function with the max arity:

auto sum = partial(limit_c<2>([](int x, int y)
{
Expand Down
8 changes: 4 additions & 4 deletions doc/src/point_free.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Point-free style programming
============================

[Point-free style](https://en.wikipedia.org/wiki/Tacit_programming) programing(or tacit programming) is a style where the arguments to the function are not explicity defined. Rather, the function is defined as the composition of other functions where function adaptors manipulate the function arguments. The advantage of using point-free style in C++ is the template machinery involved with function arguments can be avoided.
[Point-free style](https://en.wikipedia.org/wiki/Tacit_programming) programming(or tacit programming) is a style where the arguments to the function are not explicitly defined. Rather, the function is defined as the composition of other functions where function adaptors manipulate the function arguments. The advantage of using point-free style in C++ is the template machinery involved with function arguments can be avoided.

Variadic print
--------------
Expand All @@ -15,7 +15,7 @@ For example, if we want to write a variadic print function that prints each argu

print("Hello", "World");

We would write something like the following, which would recursively iterate over the arguments using varidiac templates:
We would write something like the following, which would recursively iterate over the arguments using variadic templates:

// Base case
void print()
Expand All @@ -28,7 +28,7 @@ We would write something like the following, which would recursively iterate ove
print(xs...);
}

Instead with point-free style, we can write this using the [`proj`](/include/boost/hof/by) adaptor, which calls a function on each arguments. Of course, `std::cout` is not a function, but we can make it one by using `BOOST_HOF_LIFT`:
Instead with point-free style, we can write this using the [`proj`](/include/boost/hof/by) adaptor, which calls a function on each argument. Of course, `std::cout` is not a function, but we can make it one by using `BOOST_HOF_LIFT`:

BOOST_HOF_STATIC_FUNCTION(simple_print) = BOOST_HOF_LIFT(std::ref(std::cout) << _);

Expand Down Expand Up @@ -64,7 +64,7 @@ With each argument on its own line.
Variadic sum
------------

Another example, say we would like to write a varidiac version of `max`. We could implement it like this:
Another example, say we would like to write a variadic version of `max`. We could implement it like this:

// Base case
template<class T>
Expand Down
6 changes: 3 additions & 3 deletions include/boost/hof/alias.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/// user. This allows defining extra attributes about the type outside of the
/// type itself. There are three different ways the value can be stored: as a
/// member variable, by inheritance, or as a static member variable. The value
/// can be retrieved uniformily using the `alias_value` function.
/// can be retrieved uniformly using the `alias_value` function.
///
/// Synopsis
/// --------
Expand All @@ -45,7 +45,7 @@
/// template<class Alias>
/// class alias_tag;
///
/// // Check if type has a certian tag
/// // Check if type has a certain tag
/// template<class T, class Tag>
/// class has_tag;
///
Expand Down Expand Up @@ -144,7 +144,7 @@ struct alias_static_storage
{
#ifdef _MSC_VER
// Since we disable the error for 4579 on MSVC, which leaves the static
// member unitialized at runtime, it is, therefore, only safe to use this
// member uninitialized at runtime, it is, therefore, only safe to use this
// class on types that are empty with constructors that have no possible
// side effects.
static_assert(BOOST_HOF_IS_EMPTY(T) &&
Expand Down
6 changes: 3 additions & 3 deletions include/boost/hof/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#endif


// This determines if it safe to use inheritance for EBO. On every platform
// except clang, compilers have problems with ambigous base conversion. So
// This determines if it's safe to use inheritance for EBO. On every platform
// except clang, compilers have problems with ambiguous base conversion. So
// this configures the library to use a different technique to achieve empty
// optimization.
#ifndef BOOST_HOF_HAS_EBO
Expand All @@ -58,7 +58,7 @@
#endif

// This configures the library to use manual type deduction in a few places
// where it problematic on a few platforms.
// where it's problematic on a few platforms.
#ifndef BOOST_HOF_HAS_MANUAL_DEDUCTION
#if (defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ < 8)
#define BOOST_HOF_HAS_MANUAL_DEDUCTION 1
Expand Down
2 changes: 1 addition & 1 deletion include/boost/hof/construct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ constexpr detail::construct_f<T> construct() noexcept
{
return {};
}
// These overloads are provide for consistency
// These overloads are provided for consistency
template<class T>
constexpr detail::construct_f<T> construct_forward() noexcept
{
Expand Down
2 changes: 1 addition & 1 deletion include/boost/hof/decay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/// Description
/// -----------
///
/// The `decay` function is a unary function object that returns whats given to it after decaying its type.
/// The `decay` function is a unary function object that returns what's given to it after decaying its type.
///
/// Synopsis
/// --------
Expand Down
2 changes: 1 addition & 1 deletion include/boost/hof/decorate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
///
/// The `decorate` function adaptor helps create simple function decorators.
///
/// A function adaptor takes a function and returns a new functions whereas a
/// A function adaptor takes a function and returns a new function whereas a
/// decorator takes some parameters and returns a function adaptor. The
/// `decorate` function adaptor will return a decorator that returns a
/// function adaptor. Eventually, it will invoke the function with the user-
Expand Down
2 changes: 1 addition & 1 deletion include/boost/hof/detail/delegate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

#define BOOST_HOF_DELEGATE_CONSTRUCTOR(C, T, var) BOOST_HOF_DELGATE_PRIMITIVE_CONSTRUCTOR(constexpr, C, T, var)

// Currently its faster to use `BOOST_HOF_DELEGATE_CONSTRUCTOR` than `using
// Currently it's faster to use `BOOST_HOF_DELEGATE_CONSTRUCTOR` than `using
// Base::Base;`
#if 1
#define BOOST_HOF_INHERIT_CONSTRUCTOR(Derived, Base) BOOST_HOF_DELEGATE_CONSTRUCTOR(Derived, Base, Base)
Expand Down
2 changes: 1 addition & 1 deletion include/boost/hof/eval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/// function or it can be a unary function that takes the identity function as
/// the first parameter(which is helpful to delay compile-time checking).
/// Also, additional parameters can be passed to `eval` to delay
/// compiliation(so that result can depend on template parameters).
/// compilation(so that result can depend on template parameters).
///
/// Synopsis
/// --------
Expand Down
2 changes: 1 addition & 1 deletion include/boost/hof/fix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/// used to write recursive functions.
///
/// When using `constexpr`, a function can recurse to a depth that is defined by
/// `BOOST_HOF_RECURSIVE_CONSTEXPR_DEPTH`(default is 16). There is no limitiation on
/// `BOOST_HOF_RECURSIVE_CONSTEXPR_DEPTH`(default is 16). There is no limitation on
/// recursion depth for non-constexpr functions. In addition, due to the
/// eagerness of `constexpr` to instantiation templates, in some cases, an
/// explicit return type must be specified in order to avoid reaching the
Expand Down
2 changes: 1 addition & 1 deletion include/boost/hof/flip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
///
/// Or:
///
/// * [Invocable](Invocable) with more than two argurments
/// * [Invocable](Invocable) with more than two arguments
///
/// And:
///
Expand Down
2 changes: 1 addition & 1 deletion include/boost/hof/flow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
///
/// The `flow` function adaptor provides function composition. It is useful as
/// an alternative to using the pipe operator `|` when chaining functions. It is
/// similiar to [`compose`](compose.md) except the evaluation order is
/// similar to [`compose`](compose.md) except the evaluation order is
/// reversed. So, `flow(f, g)(0)` is equivalent to `g(f(0))`.
///
///
Expand Down

0 comments on commit 814f2be

Please sign in to comment.