Add principledStringIgnoreContextMaybe
This commit is contained in:
parent
124f7165e4
commit
a488e9aa5c
|
@ -9,6 +9,7 @@ module Nix.String (
|
|||
, stringHasContext
|
||||
, principledIntercalateNixString
|
||||
, hackyStringIgnoreContextMaybe
|
||||
, principledStringIgnoreContextMaybe
|
||||
, principledStringIgnoreContext
|
||||
, hackyStringIgnoreContext
|
||||
, hackyMakeNixStringWithoutContext
|
||||
|
@ -97,6 +98,11 @@ hackyStringIgnoreContextMaybe :: NixString -> Maybe Text
|
|||
hackyStringIgnoreContextMaybe (NixString s c) | null c = Just s
|
||||
| otherwise = Nothing
|
||||
|
||||
-- | Extract the string contents from a NixString that has no context
|
||||
principledStringIgnoreContextMaybe :: NixString -> Maybe Text
|
||||
principledStringIgnoreContextMaybe (NixString s c) | null c = Just s
|
||||
| otherwise = Nothing
|
||||
|
||||
-- | Extract the string contents from a NixString even if the NixString has an associated context
|
||||
principledStringIgnoreContext :: NixString -> Text
|
||||
principledStringIgnoreContext (NixString s _) = s
|
||||
|
|
Loading…
Reference in a new issue