Commit graph

263 commits

Author SHA1 Message Date
Index Int
2516940029 Unqualified Permissions import from System.Directory 2015-05-08 02:39:19 +03:00
Index Int
563ad23499 Remove unnecessary Permissions type synonym 2015-05-08 02:28:24 +03:00
Index Int
0628598dd8 Improve chmod documentation 2015-05-08 01:45:39 +03:00
Index Int
3f8991e518 Add chmod and related definitions 2015-05-08 01:16:11 +03:00
Gabriel Gonzalez
269719087e Merge pull request #46 from int-index/master
Generalize IO to MonadIO for many functions
2015-05-06 07:34:37 -07:00
Index Int
05980936d4 Use liftM in strict to remove Functor constraint 2015-05-06 04:35:10 +03:00
Index Int
e37ce1b1e4 More descriptive parameter names in echo and err 2015-05-06 03:05:32 +03:00
Index Int
da393eecf6 Generalize IO to MonadIO for many functions 2015-05-06 02:39:46 +03:00
Gabriel Gonzalez
18550cdc8d Added slides from class that I taught on Turtle 2015-05-04 16:01:30 -07:00
Gabriel Gonzalez
7a3caa3f0a Merge pull request #44 from Profpatsch/semiring-doc
Add documentation to Num instances.
2015-05-03 17:48:35 -07:00
Profpatsch
d6b1232bc7 Revert "Remove redundant imports."
This reverts commit ea5045602a.
2015-05-04 01:53:23 +02:00
Profpatsch
74a13d8ab2 Typo. 2015-05-04 01:50:48 +02:00
Profpatsch
ea5045602a Remove redundant imports. 2015-05-04 01:49:54 +02:00
Profpatsch
0c7f9dbd2f Add documentation to Num instances. 2015-05-04 01:45:34 +02:00
Gabriel Gonzalez
55fe1c7dd5 Merge pull request #42 from Profpatsch/collect-functions
Add functions that return Exitcodes and Stdout
2015-05-03 16:16:51 -07:00
Profpatsch
79e1f57355 Rename Collect to Strict. 2015-05-04 00:56:37 +02:00
Profpatsch
b9e16e5349 Add functions that return Exitcodes and Stdout 2015-05-01 16:00:01 +02:00
Gabriel Gonzalez
ebb0d7a507 Changed exit to be a synonym for exitWith
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.
2015-04-06 09:12:31 -07:00
Gabriel Gonzalez
1af5805bb6 Updated documentation
The example for `plus` now uses `plus digit` since `plus anyChar` is obsoleted
by `chars1`
2015-04-05 18:43:39 -07:00
Gabriel Gonzalez
ab3d595b9f Added (.&&.) and (.||.). Fixes #27
These commands behave analogous to their Bash counterparts
2015-04-04 19:35:30 -07:00
Gabriel Gonzalez
e120c0555a Added (&). Fixes #28
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
2015-04-04 19:21:25 -07:00
Gabriel Gonzalez
119179ad2e Fixed numeric instances for Pattern and Shell
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.
2015-04-04 17:03:30 -07:00
Gabriel Gonzalez
ea04f280f4 Added the strict utility to the Prelude
This is most useful when you want to run the entire file's contents through a
parser instead of parsing just a single line at a time
2015-03-31 21:19:12 -07:00
Gabriel Gonzalez
771a9543be Merge branch 'master' of github.com:Gabriel439/Haskell-Turtle-Library 2015-03-31 21:09:56 -07:00
Gabriel Gonzalez
4c81a8500e Switched file input utilities to use withTextFile
This fixed encoding issues with unicode input
2015-03-31 21:09:25 -07:00
Gabriel Gonzalez
45219bc991 Merge pull request #36 from maoe/exit
Relax the return type of exit
2015-03-19 19:19:14 -07:00
Mitsutoshi Aoe
a53c80e987 Relax the return type of exit 2015-03-20 09:27:29 +09:00
Gabriel Gonzalez
ac0cd1d853 Fixed tutorial link to point to latest version 2015-03-11 18:58:41 -07:00
Gabriel Gonzalez
3ecc3d6ee7 Added asciiCI 2015-03-08 17:48:53 -07:00
Gabriel Gonzalez
57fcb66c4d Polished source code 2015-03-08 17:45:44 -07:00
Gabriel Gonzalez
0f8b6f00d4 Merge pull request #30 from PierreR/master
Fix haddock for fp
2015-02-26 14:47:04 -08:00
Pierre Radermecker
c38db4b54d Add doctest for fp 2015-02-26 23:30:21 +01:00
Pierre Radermecker
e6b6e73bcd fix fp doc: complete link to FilePath 2015-02-26 11:20:35 +01:00
Pierre Radermecker
4a96c34235 Fix haddock for fp 2015-02-26 11:09:16 +01:00
Gabriel Gonzalez
5e2089ad30 Version 1.0.1 => 1.0.2 2015-02-25 18:26:01 -08:00
Gabriel Gonzalez
4caacd32c5 Some fixes to deslash
Fixed deslash to not remove the trailing slash if it's also the initial slash

Also, I only selectively apply `deslash` for `getDirectoryPermissions`
2015-02-24 09:41:19 -08:00
Gabriel Gonzalez
4e4854402c Fixed ls to to work on ".", "..". Fixes #25
`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`
2015-02-23 22:15:43 -08:00
Gabriel Gonzalez
fbaee429ba Add high-efficiency primitives. Fixes #23
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.
2015-02-23 21:07:47 -08:00
Gabriel Gonzalez
5c5c3b5606 Moved "External commands" tutorial section later in tutorial
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.
2015-02-09 18:33:05 -08:00
Gabriel Gonzalez
6e5e9c4b76 Added -threaded to the tutorial
This fixes a bug that occurs when you feed non-empty input to `inshell` in a
compiled program.  Without the flag the program hangs.  I'm not sure why.
2015-02-09 18:25:38 -08:00
Gabriel Gonzalez
fde69d0a56 Merge pull request #20 from happy4crazy/foldIO-typo
Fix typo in Shell `foldIO` law
2015-02-09 16:36:10 -08:00
Alan O'Donnell
35c40335c2 Fix typo in Shell foldIO law 2015-02-09 18:38:49 -05:00
Gabriel Gonzalez
99479998a2 Raised lower bound on base to 4.5. Fixes #18
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.
2015-02-08 10:04:00 -08:00
Gabriel Gonzalez
dd0afe0a55 Merge pull request #14 from MaxGabriel/patch-2
Fix mismatched parentheses in stdout function
2015-02-04 15:37:34 -08:00
Gabriel Gonzalez
9e45666dd6 Merge pull request #17 from PierreR/master
Fix #16: create a Format specifier for filepaths.
2015-02-04 15:37:25 -08:00
Pierre Radermecker
8dc46a2764 Move the export of fp down after the s 2015-02-04 23:55:13 +01:00
Pierre Radermecker
130d2c11e0 Fix #16: create a Format specifier for filepaths. 2015-02-04 23:47:37 +01:00
Maximilian Tagher
e5ebee4295 Fix mismatched parentheses in stdout function 2015-02-02 21:45:28 -08:00
Gabriel Gonzalez
24c140d7db Version 1.0.0 => 1.0.1 2015-02-02 07:27:05 -08:00
Gabriel Gonzalez
d8cfa343c8 Merge pull request #12 from MaxGabriel/patch-1
Remove duplicate "the" in Tutorial
2015-02-02 06:57:24 -08:00