packages feed

from-1.0.0.0: src/From/Classes.hs

{-# LANGUAGE MultiParamTypeClasses #-}

module From.Classes (
  From (..),
  TryFrom (..),
) where

-- | The type conversion class where conversion is (mostly) safe and expected
-- to be successful.
class From a b where
  from :: a -> b

-- | The type conversion class where conversion can fail
class TryFrom a b where
  tryFrom :: a -> Maybe b