tahoe-ssk-0.3.0.0: An implementation of the Tahoe-LAFS SSK cryptographic protocols
Safe HaskellNone
LanguageHaskell2010

Tahoe.SDMF.Internal.Converting

Description

Conversion between types with a known level of safety. *Heavily* inspired by witch (which has dependencies that make it hard for us to use just yet).

Synopsis

Documentation

class From a b where Source #

Precise, infallible conversion between two types.

Methods

from :: a -> b Source #

Instances

Instances details
From Int Int64 Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

from :: Int -> Int64 Source #

From Int64 Int Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

from :: Int64 -> Int Source #

From Word8 Int Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

from :: Word8 -> Int Source #

From Word8 Word16 Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

from :: Word8 -> Word16 Source #

From Word16 Int Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

from :: Word16 -> Int Source #

From Word32 Int Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

from :: Word32 -> Int Source #

From Word32 Word64 Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

from :: Word32 -> Word64 Source #

class TryFrom a b m where Source #

Precise, fallible conversion between two types.

Methods

tryFrom Source #

Arguments

:: String

An error message for context if the conversion fails.

-> a

The value to convert.

-> m b 

Instances

Instances details
MonadFail m => TryFrom Int Word32 m Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

tryFrom :: String -> Int -> m Word32 Source #

MonadFail m => TryFrom Int Word64 m Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

tryFrom :: String -> Int -> m Word64 Source #

MonadFail m => TryFrom Int64 Word64 m Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

tryFrom :: String -> Int64 -> m Word64 Source #

MonadFail m => TryFrom Word16 Word8 m Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

tryFrom :: String -> Word16 -> m Word8 Source #

MonadFail m => TryFrom Word64 Int m Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

tryFrom :: String -> Word64 -> m Int Source #

MonadFail m => TryFrom Word64 Int64 m Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Converting

Methods

tryFrom :: String -> Word64 -> m Int64 Source #

into :: forall b a. From a b => a -> b Source #

Like from but with the order of the input/output type parameters reversed.

tryInto :: forall b a m. TryFrom a b m => String -> a -> m b Source #

Like tryFrom but with the order of the input/output type parameters reverse.