@hackage / heterogeneous-list-literals

Allows the use of tuples as literals for Heterogeneous collections

Latest0.2.0.0

About

Metadata

  • Last updated , by DavidMD
  • License BSD-3-Clause
  • Maintained by: dmillardurrant@gmail.com

  • Lottery factor: 0

Links

Installation

Readme

This is an incredibly simple library, which makes writing literals for heterogeneous collections easy

If you write a function with the signature

hList :: HLL input output => input -> HList output

then

a :: HList '[]
a = hList ()

b :: HList '[Bool]
b = hList (Only True)

c :: HList '[Bool, Int, Double, String]
c = hList (True, 24, 10.5, "Fire")

The full code is in test/Docs.hs

This only supports literals of length up to 20, though that can be easily extended using the code generator in src/Data/HeterogeneousListLiterals