Description

Another way to desugar overloaded numeric literals. See FromNatural.

An explicit list expression, e.g. [1, True] is desugared to

cons 1 (cons True nil)


Enabled with:

{-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Lists #-}

Synopsis
• class Nil a where
• class Cons x ys zs | zs -> x ys where
• cons :: x -> ys -> zs

# Documentation

class Nil a where Source #

Class for nil, []

See test-suite for ways to define instances for Map. There are at-least two-ways.

Methods

nil :: a Source #

Instances
 Nil [a] Source # Instance detailsDefined in Overloaded.Lists Methodsnil :: [a] Source # n ~ Z => Nil (Vec n a) Source # Instance detailsDefined in Overloaded.Lists Methodsnil :: Vec n a Source # xs ~ ([] :: [Type]) => Nil (NP f xs) Source # Instance detailsDefined in Overloaded.Lists Methodsnil :: NP f xs Source # xs ~ ([] :: [[Type]]) => Nil (POP f xs) Source # Instance detailsDefined in Overloaded.Lists Methodsnil :: POP f xs Source #

class Cons x ys zs | zs -> x ys where Source #

Class for Cons :.

Methods

cons :: x -> ys -> zs Source #

Instances
 Cons a [a] (NonEmpty a) Source # Instance detailsDefined in Overloaded.Lists Methodscons :: a -> [a] -> NonEmpty a Source # Cons a [a] [a] Source # Instance detailsDefined in Overloaded.Lists Methodscons :: a -> [a] -> [a] Source # Cons a (Vec n a) (Vec (S n) a) Source # Instance detailsDefined in Overloaded.Lists Methodscons :: a -> Vec n a -> Vec (S n) a Source # Cons (f x) (NP f xs) (NP f (x ': xs)) Source # Instance detailsDefined in Overloaded.Lists Methodscons :: f x -> NP f xs -> NP f (x ': xs) Source # Cons (NP f xs) (POP f xss) (POP f (xs ': xss)) Source # Instance detailsDefined in Overloaded.Lists Methodscons :: NP f xs -> POP f xss -> POP f (xs ': xss) Source #