diff options
author | Joey Hess <joeyh@joeyh.name> | 2020-01-02 12:34:10 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2020-01-02 12:42:57 -0400 |
commit | 9df8a6eb9405dde4464d27133c04f5ee539a85de (patch) | |
tree | 8a7ac5f52be8679f8a2525515a0b2c1b715c99ad /Utility/PartialPrelude.hs | |
parent | 16022a8b98f4bc134542e78a42538364d2f97d92 (diff) | |
download | git-repair-9df8a6eb9405dde4464d27133c04f5ee539a85de.tar.gz |
merge from git-annex and relicense accordingly
Merge git library and utility from git-annex. The former is now relicensed
AGPL, so git-repair as a whole becomes AGPL.
For simplicity, I am relicensing the remainder of the code in git-repair
AGPL as well, per the header changes in this commit. While that code is
also technically available under the GPL license, as it's been released
under that license before, changes going forward will be only released by
me under the AGPL.
Diffstat (limited to 'Utility/PartialPrelude.hs')
-rw-r--r-- | Utility/PartialPrelude.hs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Utility/PartialPrelude.hs b/Utility/PartialPrelude.hs index 47e9831..90c67ff 100644 --- a/Utility/PartialPrelude.hs +++ b/Utility/PartialPrelude.hs @@ -7,7 +7,18 @@ {-# OPTIONS_GHC -fno-warn-tabs #-} -module Utility.PartialPrelude where +module Utility.PartialPrelude ( + Utility.PartialPrelude.read, + Utility.PartialPrelude.head, + Utility.PartialPrelude.tail, + Utility.PartialPrelude.init, + Utility.PartialPrelude.last, + Utility.PartialPrelude.readish, + Utility.PartialPrelude.headMaybe, + Utility.PartialPrelude.lastMaybe, + Utility.PartialPrelude.beginning, + Utility.PartialPrelude.end, +) where import qualified Data.Maybe @@ -38,11 +49,9 @@ last = Prelude.last {- Attempts to read a value from a String. - - - Ignores leading/trailing whitespace, and throws away any trailing - - text after the part that can be read. - - - - readMaybe is available in Text.Read in new versions of GHC, - - but that one requires the entire string to be consumed. + - Unlike Text.Read.readMaybe, this ignores some trailing text + - after the part that can be read. However, if the trailing text looks + - like another readable value, it fails. -} readish :: Read a => String -> Maybe a readish s = case reads s of |