LIB: move maybeD to MyPrelude
This commit is contained in:
parent
f301e2e519
commit
5b1c595703
@ -95,6 +95,7 @@ import HPath
|
|||||||
, pattern Path
|
, pattern Path
|
||||||
)
|
)
|
||||||
import qualified HPath as P
|
import qualified HPath as P
|
||||||
|
import MyPrelude
|
||||||
import Safe
|
import Safe
|
||||||
(
|
(
|
||||||
atDef
|
atDef
|
||||||
@ -763,9 +764,6 @@ fromFreeVar :: (Default d) => (a -> d) -> File a -> d
|
|||||||
fromFreeVar f df = maybeD f $ getFreeVar df
|
fromFreeVar f df = maybeD f $ getFreeVar df
|
||||||
|
|
||||||
|
|
||||||
-- |A `maybe` flavor using the `Default` class.
|
|
||||||
maybeD :: (Default b) => (a -> b) -> Maybe a -> b
|
|
||||||
maybeD = maybe def
|
|
||||||
|
|
||||||
|
|
||||||
-- |Pack the modification time into a string.
|
-- |Pack the modification time into a string.
|
||||||
|
@ -19,9 +19,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||||||
module MyPrelude where
|
module MyPrelude where
|
||||||
|
|
||||||
|
|
||||||
|
import Data.Default
|
||||||
import Data.List
|
import Data.List
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
listIndices :: [a] -> [Int]
|
listIndices :: [a] -> [Int]
|
||||||
listIndices = findIndices (const True)
|
listIndices = findIndices (const True)
|
||||||
|
|
||||||
|
|
||||||
|
-- |A `maybe` flavor using the `Default` class.
|
||||||
|
maybeD :: (Default b) => (a -> b) -> Maybe a -> b
|
||||||
|
maybeD = maybe def
|
||||||
|
Loading…
Reference in New Issue
Block a user