Web.PathPieces

path-pieces-0.2.1: Components of paths.

Safe Haskell | Safe-Inferred
Language | Haskell98

Web.PathPieces

Contents

- Deprecated

Synopsis

- class PathPiece s where
  - fromPathPiece :: Text -> Maybe s
  - toPathPiece :: s -> Text
- class PathMultiPiece s where
  - fromPathMultiPiece :: [Text] -> Maybe s
  - toPathMultiPiece :: s -> [Text]
- readFromPathPiece :: Read s => Text -> Maybe s
- showToPathPiece :: Show s => s -> Text
- toSinglePiece :: PathPiece p => p -> Text
- toMultiPiece :: PathMultiPiece ps => ps -> [Text]
- fromSinglePiece :: PathPiece p => Text -> Maybe p
- fromMultiPiece :: PathMultiPiece ps => [Text] -> Maybe ps

# Documentation

class PathPiece s where #

Methods

fromPathPiece :: Text -> Maybe s #

toPathPiece :: s -> Text #

#### Instances

Instances details

PathPiece Int16 # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Int16 # toPathPiece :: Int16 -> Text #
PathPiece Int32 # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Int32 # toPathPiece :: Int32 -> Text #
PathPiece Int64 # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Int64 # toPathPiece :: Int64 -> Text #
PathPiece Int8 # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Int8 # toPathPiece :: Int8 -> Text #
PathPiece Word16 # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Word16 # toPathPiece :: Word16 -> Text #
PathPiece Word32 # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Word32 # toPathPiece :: Word32 -> Text #
PathPiece Word64 # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Word64 # toPathPiece :: Word64 -> Text #
PathPiece Word8 # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Word8 # toPathPiece :: Word8 -> Text #
PathPiece Text # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Text # toPathPiece :: Text -> Text #
PathPiece Text # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Text # toPathPiece :: Text -> Text #
PathPiece Day # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Day # toPathPiece :: Day -> Text #
PathPiece Integer # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Integer # toPathPiece :: Integer -> Text #
PathPiece String # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe String # toPathPiece :: String -> Text #
PathPiece () # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe () # toPathPiece :: () -> Text #
PathPiece Bool # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Bool # toPathPiece :: Bool -> Text #
PathPiece Int # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Int # toPathPiece :: Int -> Text #
PathPiece Word # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe Word # toPathPiece :: Word -> Text #
PathPiece a => PathPiece (Maybe a) # |
Instance details Defined in Web.PathPieces Methods fromPathPiece :: Text -> Maybe (Maybe a) # toPathPiece :: Maybe a -> Text #

class PathMultiPiece s where #

Methods

fromPathMultiPiece :: [Text] -> Maybe s #

toPathMultiPiece :: s -> [Text] #

#### Instances

Instances details

PathPiece a => PathMultiPiece [a] # |
Instance details Defined in Web.PathPieces Methods fromPathMultiPiece :: [Text] -> Maybe [a] # toPathMultiPiece :: [a] -> [Text] #

readFromPathPiece :: Read s => Text -> Maybe s #

A function for helping generate free `PathPiece` instances for enumeration data types that have derived `Read` and `Show` instances. Intended to be used like this:

    data MyData = Foo | Bar | Baz
      deriving (Read,Show)
    instance PathPiece MyData where
      fromPathPiece = readFromPathPiece
      toPathPiece = showToPathPiece

Since 0.2.1.

showToPathPiece :: Show s => s -> Text #

See the documentation for `readFromPathPiece`.

Since 0.2.1.

# Deprecated

toSinglePiece :: PathPiece p => p -> Text #

Deprecated: Use toPathPiece instead of toSinglePiece

toMultiPiece :: PathMultiPiece ps => ps -> [Text] #

Deprecated: Use toPathMultiPiece instead of toMultiPiece

fromSinglePiece :: PathPiece p => Text -> Maybe p #

Deprecated: Use fromPathPiece instead of fromSinglePiece

fromMultiPiece :: PathMultiPiece ps => [Text] -> Maybe ps #

Deprecated: Use fromPathMultiPiece instead of fromMultiPiece