servant-checked-exceptions-core-2.2.0.1: Checked exceptions for Servant APIs.
CopyrightDennis Gosnell 2017
LicenseBSD3
MaintainerDennis Gosnell (cdep.illabout@gmail.com)
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe-Inferred
LanguageHaskell2010

Servant.Checked.Exceptions.Internal.Util

Description

Additional helpers.

Synopsis
  • type family Snoc (as :: [k]) (b :: k) where ...

Documentation

type family Snoc (as :: [k]) (b :: k) where ... Source #

A type-level snoc.

Append to an empty list:

>>> Refl :: Snoc '[] Double :~: '[Double]
Refl

Append to a non-empty list:

>>> Refl :: Snoc '[Char] String :~: '[Char, String]
Refl

Equations

Snoc '[] b = '[b] 
Snoc (a ': as) b = a ': Snoc as b 
>>> :set -XDataKinds
>>> :set -XTypeOperators
>>> import Data.Type.Equality ((:~:)(Refl))