express-0.1.0: Express

Copyright(c) 2016-2019 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellSafe
LanguageHaskell2010

Data.Express.Utils.Typeable

Description

This module is part of Express.

Utilities to manipulate TypeReps (of Typeable values).

Synopsis

Documentation

elementTy :: TypeRep -> TypeRep Source #

This function returns the type of the element of a list. It will throw an error when not given the list type.

> > elementTy $ typeOf (undefined :: [Int])
Int
> > elementTy $ typeOf (undefined :: [[Int]])
[Int]
> > elementTy $ typeOf (undefined :: [Bool])
Bool
> > elementTy $ typeOf (undefined :: Bool)
*** Exception: error (elementTy): `Bool' is not a list type

(->::) :: TypeRep -> TypeRep -> TypeRep infixr 9 Source #

An infix alias for mkFunTy. It is right associative.