diff options
Diffstat (limited to 'Assistant/WebApp/Types.hs')
-rw-r--r-- | Assistant/WebApp/Types.hs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/Assistant/WebApp/Types.hs b/Assistant/WebApp/Types.hs index b88e78d67..dd3bd4383 100644 --- a/Assistant/WebApp/Types.hs +++ b/Assistant/WebApp/Types.hs @@ -5,9 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE FlexibleInstances, UndecidableInstances #-} -{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses #-} -{-# LANGUAGE TemplateHaskell, OverloadedStrings, RankNTypes #-} +{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings, RankNTypes #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Assistant.WebApp.Types where @@ -79,7 +77,22 @@ data SshData = SshData } deriving (Read, Show, Eq) -{- Allow any serializable data type to be used as a PathPiece -} -instance (Show a, Read a) => PathPiece a where +instance PathPiece SshData where + toPathPiece = pack . show + fromPathPiece = readish . unpack + +instance PathPiece NotificationId where + toPathPiece = pack . show + fromPathPiece = readish . unpack + +instance PathPiece AlertId where + toPathPiece = pack . show + fromPathPiece = readish . unpack + +instance PathPiece Transfer where + toPathPiece = pack . show + fromPathPiece = readish . unpack + +instance PathPiece PairReq where toPathPiece = pack . show fromPathPiece = readish . unpack |