As suggested by @PierreR
This is to make it more strongly typed. In the long run I'd like there to be a
`Num` instance for `ExitCode` so that we could use numeric literals directly,
but this is good enough for now.
For newer versions of base this will just re-export `Data.Function.(&)` and
for older versions I backport the definition.
The purpose of this to allow users to write pipelines from left to right and
without lots of parentheses, like this:
"123" + "456" & grep "123" & stdout
Thanks to @FranklinChen for the suggestion
I removed the `Rational` and `Fractional` instances and changed the `Num`
instances
The `Num` instances did not obey the semiring laws, which was the primary
instigator for this change. However, there is also one very practical reason
for this change, too, which is that the weaker `Monoid` constraint plays
very nicely with `Text` (which is a `Monoid`, but not a `Num`).
This means that now you can do cool things like this for `Shell`:
>>> let x = "1" <|> "2"
>>> let y = "3" <|> "y"
>>> view (x * ", " * y)
"1, 3"
"1, 4"
"2, 3"
"2, 4"
Also, you can now use algebraic operations for `Pattern`s when matching `Text`,
for the same reason.
`getDirectoryPermissions` does not work on directories that end with a
trailing slash. Unfortunately, `Filesystem.Path.decodeString` adds a
trailing slash to the end of the "." and ".." paths. Also, if you
provide a path with a trailing slash it will fail, too. This fix
uses a new `deslash` helper function to sanitize paths for
`getDirectoryPermissions`
This adds `chars` and `chars1`, which are high-efficiency versions of
`star dot` and `plus dot`, respectively. I also changed `has`, `prefix`, and
`suffix` to use these high-efficiency primitives and the performance improvement
was dramatic.
This is because the section refers to some concepts that were not taught at that
point in the tutorial. When I hastily created this section I forgot to check
that it was in the proper order.
This technically has no effect because `turtle` depends on `exceptions`,
which already has this lower bound, but it's probably a good idea to put
this lower bound anyway since I haven't verified that versions of `base`
less than 4.5 even work.