Web.PathPieces

path-pieces-0.2.1: Components of paths.

Safe Haskell | Safe
Language | Haskell98

Web.PathPieces

Contents

- Deprecated

Synopsis

- class PathPiece s where
- class PathMultiPiece s where
- 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 #

Minimal complete definition

fromPathPiece, toPathPiece

Methods

fromPathPiece :: Text -> Maybe s #

toPathPiece :: s -> Text #

Instances

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

class PathMultiPiece s where #

Minimal complete definition

fromPathMultiPiece, toPathMultiPiece

Methods

fromPathMultiPiece :: [Text] -> Maybe s #

toPathMultiPiece :: s -> [Text] #

Instances

PathPiece a => PathMultiPiece [a] # |
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