{-# LANGUAGE GADTs #-}

module Dormouse.Url.Class 
  ( IsUrl(..)
  ) where

import Dormouse.Url.Types

class (Eq url, Show url) => IsUrl url where
  asAnyUrl :: url -> AnyUrl

instance IsUrl (Url scheme) where
  asAnyUrl :: Url scheme -> AnyUrl
asAnyUrl = Url scheme -> AnyUrl
forall (scheme :: Symbol). Url scheme -> AnyUrl
AnyUrl

instance IsUrl AnyUrl where
  asAnyUrl :: AnyUrl -> AnyUrl
asAnyUrl (AnyUrl Url scheme
u) = Url scheme -> AnyUrl
forall url. IsUrl url => url -> AnyUrl
asAnyUrl Url scheme
u