Hoogle Search

Within LTS Haskell 24.25 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. replaceProperPrefix :: MonadThrow m => Path b Dir -> Path b' Dir -> Path b t -> m (Path b' t)

    path Path.Posix

    Change from one directory prefix to another. Throw NotAProperPrefix if the first argument is not a proper prefix of the path.

    >>> replaceProperPrefix $(mkRelDir "foo") $(mkRelDir "bar") $(mkRelFile "foo/file.txt") == $(mkRelFile "bar/file.txt")
    

  2. stripProperPrefix :: MonadThrow m => Path b Dir -> Path b t -> m (Path Rel t)

    path Path.Posix

    If the directory in the first argument is a proper prefix of the path in the second argument strip it from the second argument, generating a path relative to the directory. Throws NotAProperPrefix if the directory is not a proper prefix of the path. The following properties hold:

    stripProperPrefix x (x </> y) = y
    
    Cases which are proven not possible:
    stripProperPrefix (a :: Path Abs …) (b :: Path Rel …)
    
    stripProperPrefix (a :: Path Rel …) (b :: Path Abs …)
    
    In other words the bases must match.

  3. NotAProperPrefix :: FilePath -> FilePath -> PathException

    path Path.Windows

    No documentation available.

  4. isProperPrefixOf :: Path b Dir -> Path b t -> Bool

    path Path.Windows

    Determines if the path in the first parameter is a proper prefix of the path in the second parameter. The following properties hold:

    not (x `isProperPrefixOf` x)
    
    x `isProperPrefixOf` (x </> y)
    

  5. replaceProperPrefix :: MonadThrow m => Path b Dir -> Path b' Dir -> Path b t -> m (Path b' t)

    path Path.Windows

    Change from one directory prefix to another. Throw NotAProperPrefix if the first argument is not a proper prefix of the path.

    >>> replaceProperPrefix $(mkRelDir "foo") $(mkRelDir "bar") $(mkRelFile "foo/file.txt") == $(mkRelFile "bar/file.txt")
    

  6. stripProperPrefix :: MonadThrow m => Path b Dir -> Path b t -> m (Path Rel t)

    path Path.Windows

    If the directory in the first argument is a proper prefix of the path in the second argument strip it from the second argument, generating a path relative to the directory. Throws NotAProperPrefix if the directory is not a proper prefix of the path. The following properties hold:

    stripProperPrefix x (x </> y) = y
    
    Cases which are proven not possible:
    stripProperPrefix (a :: Path Abs …) (b :: Path Rel …)
    
    stripProperPrefix (a :: Path Rel …) (b :: Path Abs …)
    
    In other words the bases must match.

  7. InfixCons :: Value -> [(Name, Value)] -> Value

    pretty-show Text.Show.Pretty

    Infix data constructor chain

  8. parseHeaderWithPrefix :: FromHttpApiData a => ByteString -> ByteString -> Either Text a

    http-api-data Web.HttpApiData

    Parse given bytestring then parse the rest of the input using parseHeader.

    data BasicAuthToken = BasicAuthToken Text deriving (Show)
    
    instance FromHttpApiData BasicAuthToken where
    parseHeader h     = BasicAuthToken <$> parseHeaderWithPrefix "Basic " h
    parseQueryParam p = BasicAuthToken <$> parseQueryParam p
    
    >>> parseHeader "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" :: Either Text BasicAuthToken
    Right (BasicAuthToken "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
    

  9. parseQueryParamWithPrefix :: FromHttpApiData a => Text -> Text -> Either Text a

    http-api-data Web.HttpApiData

    Case insensitive. Parse given text case insensitive and then parse the rest of the input using parseQueryParam.

    >>> parseQueryParamWithPrefix "z" "z10" :: Either Text Int
    Right 10
    

  10. parseUrlPieceWithPrefix :: FromHttpApiData a => Text -> Text -> Either Text a

    http-api-data Web.HttpApiData

    Case insensitive. Parse given text case insensitive and then parse the rest of the input using parseUrlPiece.

    >>> parseUrlPieceWithPrefix "Just " "just 10" :: Either Text Int
    Right 10
    
    >>> parseUrlPieceWithPrefix "Left " "left" :: Either Text Bool
    Left "could not parse: `left'"
    
    This can be used to implement FromHttpApiData for single field constructors:
    >>> data Foo = Foo Int deriving (Show)
    
    >>> instance FromHttpApiData Foo where parseUrlPiece s = Foo <$> parseUrlPieceWithPrefix "Foo " s
    
    >>> parseUrlPiece "foo 1" :: Either Text Foo
    Right (Foo 1)
    

Page 97 of many | Previous | Next